Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for all possible 'lang_COUNTRY' language codes #11417

Open
hwhsu1231 opened this issue Jun 16, 2024 · 2 comments
Open

Add support for all possible 'lang_COUNTRY' language codes #11417

hwhsu1231 opened this issue Jun 16, 2024 · 2 comments

Comments

@hwhsu1231
Copy link

What's the problem this feature will solve?

ReadTheDocs currently cannot handle some 'lang_COUNTRY' language codes. For example: zh_HK, zh_SG, en_US, en_GB, etc.

Describe the solution you'd like

Add support for all possible 'lang_COUNTRY' language codes.

Alternative solutions

Provide custom language codes for users to add, similar to the solution offered by Crowdin.

Additional context

Why I submit this issue

Recently, I have been researching the internationalization of Sphinx and its integration with ReadTheDocs. I have some thoughts on the language code handling.

First of all, based on this issue from the sphinx-doc/sphinx repository, it appears that:

  • Sphinx can handle all possible 'lang_COUNTRY' language codes.
  • ReadTheDocs cannot handle all possible 'lang_COUNTRY' language codes.

Let's take Chinese as an example. Currently, ReadTheDocs supports only the following 3 locales:

  • zh: Chinese
  • zh_CN: Simplified Chinese
  • zh_TW: Traditional Chinese

This means that even if I create and maintain translation files for zh_HK and zh_SG, ReadTheDocs cannot handle these locales when deployed.

Secondly, let's consider the following examples for reference:

  • Translations of Linux Documentation:

  • Translations of JetBrains Website:

Although their language selectors typically display only the language name without specifying the country/region, the language codes in their URLs include the country/region code. This suggests that some languages are so representative of their regions that they do not need specific regional markers.

Lastly, based on this documentation of Transifex, we can see that it is suggested to use 'lang_COUNTRY' codes to represent a language.

Our first suggestion would be to be as precise as possible and use a full locale property (e.g., “fr_FR”) instead of just a generic language (e.g., “fr”). It supports alternate spellings, date formats, and other differences between countries with a shared language.

Therefore, I hope/suggest that ReadTheDocs be able to support all possible 'lang_COUNTRY' language codes.

@humitos
Copy link
Member

humitos commented Jun 17, 2024

Thanks for your suggestion. We will consider this next time we jump into translations work.

@hwhsu1231
Copy link
Author

BTW, I am wondering whether it is necessary to differentiate between en_US and en_GB by using "American English" and "British English" respectively as language names:

  • en_US: American English
  • en_GB: British English

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants