Re: Add a new language [Valencian as a dialect of Catalan]
Guenter Milde via Docutils-develop <[email protected]>
| Newsgroups | gmane.text.docutils.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Toni, dear Docutils developers,
>> On Wed, 26 Jul 2023 Antoni Bella Pérez wrote:
> 28 de juliol de 2023, engelbert gruber va escriure:
On 2023-07-29, Antoni Bella Pérez wrote:
>>> I need help to decide what needs to be added to docutils so that
>>> Valencian language be admitted as a language.
>> ca-va (ca_va for the module) ... looks good to me
I see a strong case for the `IETF language tag`_ "ca-valencia", with
primary language subtag "ca" and the IETF-registered variant subtag
"valencia". (I don't see how "ca-va" would fit in the `IETF language
tag`_ syntax.)
.. _IETF language tag:
https://en.wikipedia.org/wiki/IETF_language_tag
> 'va' isn't any country, as a variant it should be 'ca-va' (without the
> underscore), which is the translation of 'ca@va'.
We have to distinguish the tag used in the `language_code setting`_
(which is also written to the HTML document) and the Python `language module
name`_.
According to `BCP 47`_,
A language tag is composed from a sequence of one or more "subtags",
[...]
distinguished and separated from other subtags in a tag by a hyphen
("-", [Unicode] U+002D).
...
There are different types of subtag, each of which is distinguished by
length, position in the tag, and content [...]
...
[...] language tags and their subtags [...] are to be treated as case
insensitive
The `docutils.languages.LanguageImporter` selects a matching language
module.
"Docutils Internationalization" describes how to get a matching Python
`language module name`_:
* For case insensitivity, we use only lowercase in the module name.
* Subtags are separated from primary tags by underscores instead of
hyphens to conform to Python naming rules.
For Valencian, the module name would become ``ca_valencia.py``.
.. _language_code setting:
https://docutils.sourceforge.io/docs/user/config.html#language-code
.. _language module name:
https://docutils.sourceforge.io/docs/howto/i18n.html#language-module-names
.. _BCP 47:
https://www.rfc-editor.org/rfc/bcp/bcp47.txt
> Can docutils support 'ca-va'?
Only, if "ca-valencia" is generally unacceptable and there is a
convincing case and consensus for using "ca-va" instead.
With Docutils 0.20, the current LanguageImporter code, both "ca-valencia"
and "ca-va" can be used and automatically selects the Catalan language
module(s) ``ca.py``. The "html5" writer uses the "language-code" setting
unchanged, e.g.::
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ca-va" lang="ca-va">
> Note you that if the country is added it would be 'ca-va_es' (it is only
> presented in order to understand the subject) which is not desired by any
> side.
Note, that with "ca-valencia", the canonical IETF tag including would
become "ca-ES-valencia" as the subtag order is fixed and "variant" comes
after "region".
Docutils would look for "ca_es_valencia", "ca_es.py", "ca_valencia.py",
and "ca.py" language module(s) and use the first match.
>>> language be admitted as a language. As a note, I would like to state
>>> that we reuse Catalan as much as possible:
>>> - The 'ca' translations in docutils too - no need to touch them
...
>>> With all this, how do you see it?
If there is no difference between Catalan and Valencian in the
translations in "docutils/languages/ca.py" and
"docutils/parsers/rst/languages/ca.py", using "ca-va" or "ca-valencia"
should work out of the box since Docutils 0.10 (2012-12-16).
>>> The reason is to be able to generate content with Sphinx.
I cannot tell about the Sphinx language features.
Hope this helps,
Günter
_______________________________________________
Docutils-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-develop
Please use "Reply All" to reply to the list.