Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIPM final review: "NOTE :" French typographic rule inserts empty space before colons #191

Closed
ronaldtse opened this issue Sep 15, 2022 · 23 comments
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link
Contributor

From BIPM Janet Miles:

There are a number of differences between standard French and English typographic rules, but in particular in French there is an inseparable space before a colon (:)

This applies to the "NOTE:" display, where an empty space needs to be "NOTE :" not "NOTE:".

@ronaldtse ronaldtse added the enhancement New feature or request label Sep 15, 2022
@ronaldtse ronaldtse moved this to 🆕 New in Metanorma Sep 15, 2022
@ronaldtse ronaldtse moved this from 🆕 New to 🏔 High priority in Metanorma Sep 15, 2022
@ronaldtse ronaldtse moved this from 🏔 High priority to 🆕 New in Metanorma Sep 15, 2022
@ronaldtse ronaldtse moved this from 🆕 New to 🏔 High priority in Metanorma Sep 15, 2022
@opoudjis
Copy link
Contributor

Crap, that is in fact universal for inserted text. It will need to be a l10n( ) function, and because l10n() is already used to capture issues with Chinese, that should be sufficient.

@ronaldtse
Copy link
Contributor Author

Thank you @opoudjis , it's comforting to know that the existing l10n implementation can handle this.

@ronaldtse ronaldtse added this to the Final review complete milestone Sep 17, 2022
@opoudjis opoudjis moved this from 🏔 High priority to 🏗 In progress in Metanorma Sep 22, 2022
@opoudjis opoudjis moved this from 🏗 In progress to 🏔 High priority in Metanorma Sep 23, 2022
@opoudjis opoudjis moved this from 🏔 High priority to 🆕 New in Metanorma Sep 23, 2022
@opoudjis opoudjis moved this from 🆕 New to 🏔 High priority in Metanorma Sep 23, 2022
@opoudjis opoudjis moved this from 🏔 High priority to 🏗 In progress in Metanorma Sep 24, 2022
@opoudjis
Copy link
Contributor

opoudjis commented Sep 25, 2022

French practice varies by locale. We haven't done locales yet, and our assumption of two-character languages is so universal in the code, that it would be more straight forward to introduce locale as a distinct parameter in configuration, alongside language and script. I'm going to code this in, although for now we are only going to implement French practice.

https://fr.wikipedia.org/wiki/Comparatif_des_diff%C3%A9rents_codes_typographiques_francophones

  • fr-FR: full nbsp before colon, narrow nbsp before »;?!, narrow nbsp after « [if no narrow nbsp available, full nbsp can be used]
  • fr-CF: narrow nbsp before colon, narrow nbsp before »;?!, narrow nbsp after «
    ** Some France French typographers think that's a good idea, but it isn't general practice
  • fr-BE: same as fr-FR
  • fr-CA: full nbsp before colon, narrow nbsp before », narrow nbsp after «, narrow or no space before ;?! [i.e. if no narrow nbsp available, don't use full nbsp]

Since we do have narrow nbsp, this becomes:

  • narrow nbsp before »;?!, narrow nbsp after «
  • full nbsp before colon everywhere but Switzerland
  • narrow nbsp before colon in Switzerland

@opoudjis
Copy link
Contributor

This raises the prospect of whether we should be applying such localisation retrospectively to main body text. For the time being, we won't, too much risk of things going wrong.

opoudjis added a commit to metanorma/metanorma.org that referenced this issue Sep 25, 2022
@opoudjis
Copy link
Contributor

@ronaldtse Please query ISO and IEC whether they want to apply Swiss French or France French localisation to colons. If I don't hear back, I'll leave it France French.

opoudjis added a commit to metanorma/metanorma-standoc that referenced this issue Sep 25, 2022
opoudjis added a commit to metanorma/isodoc-i18n that referenced this issue Sep 25, 2022
opoudjis added a commit to relaton/relaton-render that referenced this issue Sep 25, 2022
opoudjis added a commit to relaton/relaton-render that referenced this issue Sep 25, 2022
opoudjis added a commit to metanorma/mn-requirements that referenced this issue Sep 25, 2022
@opoudjis
Copy link
Contributor

Needed to remove direct dependency of isodoc on isodoc-i18n, since isodoc depends on relaton-render and mn-requirements, which also depend on isodoc-i18n

opoudjis added a commit to metanorma/isodoc that referenced this issue Sep 25, 2022
@opoudjis
Copy link
Contributor

The good news is that French punctuation localisation is implemented, although it's caused @CAMOBAP some grief because of circular development dependencies. We are seeing it show up now in Requirements encoding as well.

The bad news is... what "NOTE:"? The automatically inserted text is just "NOTE".

Imagine my irritation when I discovered...

Στιγμιότυπο 2022-09-25, 19 52 57

Στιγμιότυπο 2022-09-25, 19 53 16

... that the PDF is inserting the colon independently of the Presentation XML.

@Intelligent2013 because of this ticket, we have localisation applied to any punctuation in text inserted by Metanorma, and that includes ":" after NOTE. That means that in this instance, I should be inserting the colon, not you, so that I can localise the colon in French to have nsbp before it.

Please

  • let me know which templated text you are inserting colon after for BIPM
  • remove your colon insertion, so that I can insert it with appropriate localisation in Presentation XML instead.

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Sep 25, 2022

@opoudjis in BIPM XSLT, colon puts after:

  1. Part.sg localized string + bibdata/ext/structuredidentifier/part:
    image

(example PDF: /~https://github.com/metanorma/bipm-si-brochure/blob/gh-pages/documents/mep-mole-definition-en.pdf, page 3)

  1. Sub-part, or Partie de sub (depends on language, fixed text in XSLT) + bibdata/ext/structuredidentifier/subpart. I don't have any example, but this text renders immediately after the text from 1.

  2. note/name in the preface:

    • If language is fr, then text  : added after note/name
    • otherwise :
      image
      (example from BIPM SI brochure FR)
  3. termnote/name:

    • If language is fr, then text  : added after termnote/name
    • otherwise, :
      image

(Example from mep-candela-rapport-en.pdf)

  1. note/name in non-preface sections:
    • if language is fr, then text in note/name replaced by:

      • Remarque : , if note in list item
      • Note :
    • if language is en, then text in note/name replaced by:

      • Note:

      image
      ...
      image

(Examples from BIPM SI brochure FR)

If something isn't clear, please ping me.

@opoudjis
Copy link
Contributor

Shit.

OK, this is more work than I'd hoped for, to move all this logic into Presentation XML, but that is what I'm going to have to do.

For whatever reason, the first note in the preface is not getting space before the colon. But I'm going to take responsibility for all of this over, including the Note/Remarque distinction (which needs to appear in HTML too).

@opoudjis
Copy link
Contributor

@Intelligent2013 1, 2: these are inserted into <title language="en" format="text/plain" type="part"> and type="subpart", right? And that happens consistently for all documents with part titles?

@opoudjis
Copy link
Contributor

3 is what failed, and I don't know why.

opoudjis added a commit to metanorma/metanorma-bipm that referenced this issue Sep 25, 2022
@opoudjis
Copy link
Contributor

I've implemented 3-6.

@Intelligent2013
Copy link
Contributor

@opoudjis

1, 2: these are inserted into <title language="en" format="text/plain" type="part"> and type="subpart", right?

Yes, the part's localized string and part's number render before these titles.

And that happens consistently for all documents with part titles?

Currently, the part/subpart titles render only for Appendix documents (with value in bibdata/ext/structuredidentifier/appendix) on two pages:

  • cover page:
    image
    (Example from mep-mole-definition-en.pdf)
    NOTE: Part localized string + number and titles renders in different places that on 3rd page.

  • 3rd page
    image

@Intelligent2013
Copy link
Contributor

... What if I generate two titles? One "part", and one "part-with-numbering"? Can you select one or the other?

Yes, sure.

@Intelligent2013
Copy link
Contributor

@opoudjis there is a typo in my comment (updated above). Instead of termnote should be note, i.e.:

  1. note/name in the preface:
    • If language is fr, then text &#xa0;: added after termnote/name

should be:

  1. note/name in the preface:
    • If language is fr, then text &#xa0;: added after note/name

I've implemented 3-6.

I've generated FR presentation xml with metanorma-bipm from branch fix/note-rendering, and:

  • note in the preface has name:
<name>Note:</name>

instead of

<name>NOTE : </name>
  • there aren't spaces around :, for instance:
<note id="_"><name>Remarque:</name><p id="_">cette fréquence correspond à la moitié de 

And I don't know what is happened here.
00-preface.adoc changed in 8acfc07#diff-e71d3792f85922d11579c041ba90b3aa12e272669aa164e473cb33130c1f68cf:
image

and in XML there aren't B. and J. before last names now:

<td align="center" valign="top">
	<ol id="_7fcac708-d0af-4b30-85e9-616cd5b1bfe3" type="upperalpha">
		<li>
			<p id="_8b56e097-159d-363a-25e9-ff7392921eaf">Inglis
                                    <br/>Président du CIPM</p>
		</li>
	</ol>
</td>
<td align="center" valign="top">
	<ol id="_276917e4-1d26-3d0f-0985-80cfaec695be" type="upperalpha">
		<li>
			<p id="_f6e5f388-8dc3-25d9-d73e-e858106095e0">Ullrich
                                    <br/>Président du CCU</p>
		</li>
	</ol>
</td>

Previous XML:

<td align="center" valign="top">
	<p id="_4ec62cb2-9b52-5fda-779a-19faaa9d9448">B.Inglis
                            <br/>Président du CIPM</p>
</td>
<td align="center" valign="top">
	<p id="_a6879263-38a2-d9e9-49a0-94931039e56e">J.Ullrich
                            <br/>Président du CCU</p>
</td>

ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Sep 26, 2022
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Sep 26, 2022
opoudjis added a commit to metanorma/isodoc that referenced this issue Sep 26, 2022
@opoudjis
Copy link
Contributor

I didn't understand the subtlety. OK, preface notes are capitalised, main body notes are not, got it.

The spacing around gems is introduced by isodoc-i18n, major version update, so it will work now (release was yesterday). As you know, there's a lot of dependencies.

@opoudjis
Copy link
Contributor

opoudjis commented Sep 27, 2022

I've updated title[@type = 'part'] to have a duplicate part-with-numbering, and I've capitalised preface note names.

It is obvious what has happened with the B. and J.:

<ol id="_276917e4-1d26-3d0f-0985-80cfaec695be" type="upperalpha">

Asciidoctor is interpreting "B. " and "J. " at the beginning of a paragraph as ordered list ordinals. Yes, I know it's stupid.

Your workaround is to replace the space with &#xa0; (NBSP), which you should be doing anyway.

OK, let me know if these work.

@opoudjis opoudjis moved this from 🏗 In progress to 👀 In review in Metanorma Sep 27, 2022
opoudjis added a commit to metanorma/metanorma-bipm that referenced this issue Sep 27, 2022
opoudjis added a commit to metanorma/metanorma-bipm that referenced this issue Sep 27, 2022
@Intelligent2013
Copy link
Contributor

The spacing around gems is introduced by isodoc-i18n, major version update, so it will work now (release was yesterday). As you know, there's a lot of dependencies.

@opoudjis which gem/branches should I specify in Gemfile?

I've tried this Gemfile:

source "https://rubygems.org"

# gem "debug"
gem "metanorma-cli"
gem "metanorma-bipm", git: "/~https://github.com/metanorma/metanorma-bipm", branch: "fix/note-rendering"
gem "isodoc-i18n", git: "/~https://github.com/metanorma/isodoc-i18n", branch: "master"
gem "sassc"

but again, there aren't spaces:

<note id="_"><name>NOTE:</name><p id="_">La CGPM
...
<note id="_"><name>Remarque:</name>

@opoudjis
Copy link
Contributor

opoudjis commented Sep 28, 2022

And isodoc

Although... I've done a release, which means that should not be necessary

@Intelligent2013
Copy link
Contributor

Gemfile:

source "https://rubygems.org"

# gem "debug"
gem "metanorma-cli"
gem "metanorma-bipm", git: "/~https://github.com/metanorma/metanorma-bipm", branch: "fix/note-rendering"
gem "isodoc", git: "/~https://github.com/metanorma/isodoc"
gem "isodoc-i18n", git: "/~https://github.com/metanorma/isodoc-i18n", branch: "master"
gem "sassc"

bundle update:

Fetching /~https://github.com/metanorma/isodoc-i18n 
Fetching /~https://github.com/metanorma/isodoc

[!] There was an error while loading `isodoc.gemspec`: uninitialized constant IsoDoc::VERSION. Bundler cannot continue.

#  from C:/tools/ruby31/lib/ruby/gems/3.1.0/bundler/gems/isodoc-677e78a63f61/isodoc.gemspec:9
#  -------------------------------------------
#    # spec.metadata["rubygems_mfa_required"] = "true"
>  end
#  # coding: utf-8
#  -------------------------------------------

@Intelligent2013
Copy link
Contributor

Ok now.

@Intelligent2013
Copy link
Contributor

I've updated title[@type = 'part'] to have a duplicate part-with-numbering, ..

Found issue.
Currently, in mep-mole-definition-en.presentation.xml:

<title language="en" format="text/plain" type="part-with-numbering">Part 2: Mise en pratique for the definition of the mole in the SI</title>

but expected:

<title language="en" format="text/plain" type="part-with-numbering">Part 6.1: Mise en pratique for the definition of the mole in the SI</title>

I.e.

<structuredidentifier>
	<docnumber>SI MEP Mol1</docnumber>
	<part>6.1</part>
	<appendix>2</appendix>
</structuredidentifier>

@Intelligent2013
Copy link
Contributor

Fixed:

<title language="en" format="text/plain" type="part-with-numbering">Part 6.1: Mise en pratique for the definition of the mole in the SI</title>

@opoudjis thanks!

Repository owner moved this from 👀 In review to ✅ Done in Metanorma Sep 28, 2022
@ronaldtse ronaldtse removed this from Metanorma Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants