From: Guenter M. <mi...@us...> - 2017-05-12 12:56:45
|
On 2017-05-11, Matěj Cepl wrote: > On 2017-05-11, 12:40 GMT, Guenter Milde wrote: >> .../docutils/languages/cs.py >> .../docutils/parsers/rst/languages/cs.py > Especially the second file looks quite hopelessly :( >>> You can try "-l cs", but you end up with the language >>> "cs-US", which >>> I'm guessing you do not want. >> This seems wrong in any case. It should stay "cs" without the optional >> region subtag. > I would think the default to be cs_CS (as in de_DE, fr_FR, > es_ES, it_IT etc., which are all “safe, default” dialects of the > main language) I agree, that the "main country" is a reasonable default for cases where some back-end application *requires* a region subtag.¹ > which is wrong however, because CS was the > abbreviation for Czechoslovakia and it does not exist anymore. Note the difference: "cs" is the tag for the Czech language while the region tag (ISO 3166-1 alpha-2 code) for the Czech Republic is "CZ". If a region subtag is required, "cs-CZ" should be used for the Czech language. Docutils should accept and work with the generic tag "cs" and expand it to "cs-CZ" in cases where it would be misinterpreted as "cs-US" by some dumb back-end. Günter ¹ However, it is not "safe", as *any* region subtag narrows the specification: 2.1. Syntax A language tag is composed from a sequence of one or more "subtags", each of which refines or narrows the range of language identified by the overall tag. -- BCP 47 2.2.4. Region Subtag Region subtags are used to indicate linguistic variations associated with or appropriate to a specific country, territory, or region. Typically, a region subtag is used to indicate variations such as regional dialects or usage, or region-specific spelling conventions. ... the region subtag MAY be omitted, as when it adds no distinguishing value to the tag. -- BCP 47 |