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

Append Language Codes to Language Names in the Dropdown Menu of the Language Field in RTD Admin #11418

Open
hwhsu1231 opened this issue Jun 17, 2024 · 5 comments
Labels
Needed: more information A reply from issue author is required

Comments

@hwhsu1231
Copy link

What's the problem this feature will solve?

We are unable to look up the language code corresponding to each language name directly.

Screenshot_20240617_145901

Describe the solution you'd like

Append Language Codes to Language Names in the Dropdown Menu of the Language Field in RTD Admin. For example:

Chinese (zh)
Traditional Chinese (zh_TW)
Simplified Chinese (zh_CN)

Alternative solutions

None

Additional context

None

@humitos
Copy link
Member

humitos commented Jun 17, 2024

Hi! Thanks for opening this issue. Can you expand a little more on what's the use case for this request? I'm not super familiar with this. Why would it be useful for? 🙏🏼

@humitos humitos added the Needed: more information A reply from issue author is required label Jun 17, 2024
@hwhsu1231
Copy link
Author

hwhsu1231 commented Jun 17, 2024

Hello, @humitos.

Hi! Thanks for opening this issue. Can you expand a little more on what's the use case for this request? I'm not super familiar with this. Why would it be useful for? 🙏🏼

Suppose that someone want to translate Traditional Chinese.

First of all, there is no limitation for Sphinx to generate Gettext PO files with different language codes (based on this issue). Suppose that a user want to translate "Traditional Chinese in Hong Kong" whose language code is normally zh_HK. However, ReadTheDocs cannot handle zh_HK currently. Therefore, even though he maintains the PO files for zh_HK, it won't work when deployed to ReadTheDocs unless it is supported.

Therefore, this change should be helpful for users who want to translate different languages before getting started. They can check whether their wished language is currently supported by ReadTheDocs in advanced.

NOTE: I also recommend that ReadTheDocs add the currently-supported languages list/table with corresponding Names and Codes in its Documentation. For example:

Supported Languages:

Language Name Language Code
Chinese zh
Simplified Chinese zh_CN
Traditional Chinese zh_TW

@humitos
Copy link
Member

humitos commented Jun 17, 2024

I understand that Read the Docs currently doesn't support specific language codes, but that's the other issue you opened at #11417. This issue refers to displaying the language codes in the dropdown selector --which I'm not sure they are going to be useful and will probably just add more confusion. I guess that "Brazilian Portuguese" should be enough for pt_BR and we don't to expose the language code there.

@hwhsu1231
Copy link
Author

hwhsu1231 commented Jun 18, 2024

I guess that "Brazilian Portuguese" should be enough for pt_BR and we don't to expose the language code there.

But in different platforms, the same language name sometimes uses different language codes:

Therefore, in my opinion, it would be helpful to check the language code corresponding to each language name.

@hwhsu1231
Copy link
Author

Besides, I also noticed that there are two "Ukrainian" options in the dropdown menu currently. After checking its source code by pressing Crtl+U, I found that one of them is uk and the other is uk-ua.

<option value="uk">Ukrainian</option>
<option value="uk-ua">Ukrainian</option>

image

If this was intentional and not a mistake from Read the Docs, then I think it is helpful for users to recognize which option is excatly what they want by adding corresponding language codes.

Since some languages of specific countries/regions are so representative, maybe Read the Docs can provide the same language names with different language codes for those languages. For example:

English (en)
English (en-us)
Japanese (ja)
Japanese (ja-jp)
German (de)
German (de-de)
French (fr)
French (fr-fr)
Ukrainian (uk)
Ukrainian (uk-ua)
...etc

By doing this, backward compatibility can be maintained as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: more information A reply from issue author is required
Projects
None yet
Development

No branches or pull requests

2 participants