metanorma / metanorma-gb

Metanorma processor for GB: write Chinese Standards using GbDoc
BSD 2-Clause "Simplified" License
2 stars 3 forks source link

language-specific [zh] should be [zh-Hans] or [zh,Hans] #18

Closed ronaldtse closed 6 years ago

ronaldtse commented 6 years ago

To mark a language tag in content we currently have to use the [zh]#XXX# syntax.

However in GB standards currently only zh (Chinese) in Hans (Simplified script) is allowed, so it should really be [zh-Hans] to differentiate with [zh-Hant] for Traditional script (which one day may be possible).

opoudjis commented 6 years ago

Disagree. So long as the document is only in traditional or only in simplified script, the additional indication of the script is redundant. Remember that end users have to type this in. The proper solution is to allow the script to be specified as a document attribute.

ronaldtse commented 6 years ago

The solution to use a document attribute to set the script is a for shorthand usage, i.e. zh => zh-Hant or zh-Hans. For most usage this is fine, but this will not allow the mixture of two scripts.

However, in a document itself (BasicDocument) there should be a possibility to tag text with different scripts and languages.

opoudjis commented 6 years ago

Ok, as long as we permit both zh and zh-Hant, zh-Hans.

opoudjis commented 6 years ago

zh-Hans at the moment does nothing. zh-Hant, if detected, will create a span of PMingLiU. The if detected is important, because in many contexts it won't be (terms and headers don't parse the internals of their strings), and when it is, it does so by injecting a new <string> element which is not part of asciidoctor-gb.

There is a hook there for zh-Hant, then, but at the moment I consider this an easter egg rather than core GB functionality.

opoudjis commented 6 years ago

It's less than you'd have liked to see, but with a backlog of 50 tickets and this truly outside the scope of GB standards, I propose this will have to do for now.