metanorma / bipm-si-brochure

SI Brochure edition 9, semantic encoded version (WARNING: DRAFT)
3 stars 0 forks source link

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

Closed ronaldtse closed 2 years ago

ronaldtse commented 2 years ago

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:".

opoudjis commented 2 years ago

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 commented 2 years ago

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

opoudjis commented 2 years ago

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

Since we do have narrow nbsp, this becomes:

opoudjis commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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

Intelligent2013 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

opoudjis commented 2 years ago

I've implemented 3-6.

Intelligent2013 commented 2 years ago

@opoudjis

1, 2: these are inserted into and type="subpart", right? </p> </blockquote> <p>Yes, the part's localized string and part's number render before these titles.</p> <blockquote> <p>And that happens consistently for all documents with part titles?</p> </blockquote> <p>Currently, the part/subpart titles render only for Appendix documents (with value in <code>bibdata/ext/structuredidentifier/appendix</code>) on two pages:</p> <ul> <li> <p>cover page: <img src="https://user-images.githubusercontent.com/5559926/192144272-34e5a009-370f-4587-9528-c0b11a0bf9da.png" alt="image" /> (Example from mep-mole-definition-en.pdf) NOTE: Part localized string + number and titles renders in different places that on 3rd page.</p> </li> <li> <p>3rd page <img src="https://user-images.githubusercontent.com/5559926/192139590-4b49a895-02d5-4707-9ced-ffce974f61c6.png" alt="image" /></p> </li> </ul> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>... What if I generate two titles? One "part", and one "part-with-numbering"? Can you select one or the other?</p> </blockquote> <p>Yes, sure.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>@opoudjis there is a typo in my comment (updated above). Instead of <code>termnote</code> should be <code>note</code>, i.e.:</p> <ol start="3"> <li><code>note/name</code> in the <code>preface</code>: <ul> <li>If language is <code>fr</code>, then text <code>&#xa0;:</code> added after <code>termnote/name</code></li> </ul></li> </ol> <p>should be:</p> <ol start="3"> <li><code>note/name</code> in the <code>preface</code>: <ul> <li>If language is <code>fr</code>, then text <code>&#xa0;:</code> added after <code>note/name</code></li> </ul></li> </ol> <blockquote> <p>I've implemented 3-6.</p> </blockquote> <p>I've generated FR presentation xml with metanorma-bipm from branch <code>fix/note-rendering</code>, and:</p> <ul> <li>note in the preface has name: <pre><code><name>Note:</name></code></pre></li> </ul> <p>instead of </p> <pre><code><name>NOTE : </name></code></pre> <ul> <li>there aren't spaces around <code>:</code>, for instance: <pre><code class="language-xml"><note id="_"><name>Remarque:</name><p id="_">cette fréquence correspond à la moitié de </code></pre></li> </ul> <p>And I don't know what is happened here. <code>00-preface.adoc</code> changed in <a href="https://github.com/metanorma/bipm-si-brochure/commit/8acfc07f13e388945fc0c3c3b0cd715be064bbe6#diff-e71d3792f85922d11579c041ba90b3aa12e272669aa164e473cb33130c1f68cf">https://github.com/metanorma/bipm-si-brochure/commit/8acfc07f13e388945fc0c3c3b0cd715be064bbe6#diff-e71d3792f85922d11579c041ba90b3aa12e272669aa164e473cb33130c1f68cf</a>: <img src="https://user-images.githubusercontent.com/5559926/192163080-b6761ea1-a502-4d81-9bdb-f6f4da192046.png" alt="image" /></p> <p>and in XML there aren't <code>B.</code> and <code>J.</code> before last names now:</p> <pre><code class="language-xml"><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></code></pre> <p>Previous XML:</p> <pre><code class="language-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></code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/opoudjis"><img src="https://avatars.githubusercontent.com/u/1911039?v=4" />opoudjis</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>I didn't understand the subtlety. OK, preface notes are capitalised, main body notes are not, got it.</p> <p>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.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/opoudjis"><img src="https://avatars.githubusercontent.com/u/1911039?v=4" />opoudjis</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>I've updated <code>title[@type = 'part']</code> to have a duplicate part-with-numbering, and I've capitalised preface note names.</p> <p>It is obvious what has happened with the B. and J.:</p> <p><code><ol id="_276917e4-1d26-3d0f-0985-80cfaec695be" type="upperalpha"></code></p> <p>Asciidoctor is interpreting "B. " and "J. " at the beginning of a paragraph as ordered list ordinals. Yes, I know it's stupid.</p> <p>Your workaround is to replace the space with <code>&#xa0;</code> (NBSP), which you should be doing anyway.</p> <p>OK, let me know if these work.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>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.</p> </blockquote> <p>@opoudjis which gem/branches should I specify in <code>Gemfile</code>?</p> <p>I've tried this <code>Gemfile</code>:</p> <pre><code>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"</code></pre> <p>but again, there aren't spaces:</p> <pre><code class="language-xml"><note id="_"><name>NOTE:</name><p id="_">La CGPM ... <note id="_"><name>Remarque:</name></code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/opoudjis"><img src="https://avatars.githubusercontent.com/u/1911039?v=4" />opoudjis</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>And isodoc</p> <p>Although... I've done a release, which means that should not be necessary</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>Gemfile:</p> <pre><code>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" </code></pre> <p><code>bundle update</code>:</p> <pre><code>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 # -------------------------------------------</code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>Ok now.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>I've updated <code>title[@type = 'part']</code> to have a duplicate part-with-numbering, ..</p> </blockquote> <p>Found issue. Currently, in <code>mep-mole-definition-en.presentation.xml</code>:</p> <pre><code class="language-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></code></pre> <p>but expected:</p> <pre><code class="language-xml"><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></code></pre> <p>I.e.</p> <pre><code class="language-xml"><structuredidentifier> <docnumber>SI MEP Mol1</docnumber> <part>6.1</part> <appendix>2</appendix> </structuredidentifier></code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Intelligent2013"><img src="https://avatars.githubusercontent.com/u/5559926?v=4" />Intelligent2013</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>Fixed:</p> <pre><code class="language-xml"><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></code></pre> <p>@opoudjis thanks!</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>