Closed ronaldtse closed 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.
Thank you @opoudjis , it's comforting to know that the existing l10n implementation can handle this.
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:
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.
@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.
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
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...
... 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
@opoudjis in BIPM XSLT, colon puts after:
Part.sg
localized string + bibdata/ext/structuredidentifier/part
:
(example PDF: https://github.com/metanorma/bipm-si-brochure/blob/gh-pages/documents/mep-mole-definition-en.pdf, page 3)
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.
note/name
in the preface
:
fr
, then text  :
added after note/name
:
(example from BIPM SI brochure FR)termnote/name
:
fr
, then text  :
added after termnote/name
:
(Example from mep-candela-rapport-en.pdf)
note/name
in non-preface
sections:
fr
, then text in note/name
replaced by:
Remarque :
, if note
in list itemNote :
if language is en
, then text in note/name
replaced by:
Note:
...
(Examples from BIPM SI brochure FR)
If something isn't clear, please ping me.
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).
@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?
3 is what failed, and I don't know why.
I've implemented 3-6.
@opoudjis
1, 2: these are inserted into
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: (Example from mep-mole-definition-en.pdf) NOTE: Part localized string + number and titles renders in different places that on 3rd page.
3rd page
... What if I generate two titles? One "part", and one "part-with-numbering"? Can you select one or the other?
Yes, sure.
@opoudjis there is a typo in my comment (updated above). Instead of termnote
should be note
, i.e.:
note/name
in the preface
:
fr
, then text  :
added after termnote/name
should be:
note/name
in the preface
:
fr
, then text  :
added after note/name
I've implemented 3-6.
I've generated FR presentation xml with metanorma-bipm from branch fix/note-rendering
, and:
<name>Note:</name>
instead of
<name>NOTE : </name>
:
, 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 https://github.com/metanorma/bipm-si-brochure/commit/8acfc07f13e388945fc0c3c3b0cd715be064bbe6#diff-e71d3792f85922d11579c041ba90b3aa12e272669aa164e473cb33130c1f68cf:
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>
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.
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  
(NBSP), which you should be doing anyway.
OK, let me know if these work.
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>
And isodoc
Although... I've done a release, which means that should not be necessary
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
# -------------------------------------------
Ok now.
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>
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!
From BIPM Janet Miles:
This applies to the "NOTE:" display, where an empty space needs to be "NOTE :" not "NOTE:".