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

Translate Switcher #238

Closed
StanFromIreland opened this issue Dec 27, 2024 · 14 comments
Closed

Translate Switcher #238

StanFromIreland opened this issue Dec 27, 2024 · 14 comments

Comments

@StanFromIreland
Copy link
Contributor

StanFromIreland commented Dec 27, 2024

I propose translating the languages in the switcher to their native name so that the translations are more accessible.

Examples of where this is done

un.org

un.org screenshot

image

google.com Uses both the local language name and the language's native name

google.com screenshot

image

cppreference.com

cppreference.com screenshot

image

@AA-Turner
Copy link
Member

I'd support being able to translate the switcher, so e.g. French would be able to switch to Anglais, but I think that the English documentation should use the English names for languages -- especially given some languages use non-latin scripts.

There has been talk in the past of changing the switcher to use a dedicated 'choose language' page, which would give us more options here -- for example using the language's local name and 'native' name, i.e. French / Français. This pattern is used for example in the React documentation, sort-of in PHP (the documentation landing page requires choosing a language), and on the Apple website.

For contrast, Rust uses a switcher (though hidden at the bottom of the page), MDN has a switcher in native languages/scripts, and Go doesn't have translations on their official website.

A

@m-aciek
Copy link
Contributor

m-aciek commented Dec 28, 2024

The order now is sorted alphabetically by ISO codes of languages.

I would oppose to translate language names and sort alphabetically, because then the order of languages would be not stable, would change from language to language and that would create a bad user experience, in my opinion.

@m-aciek
Copy link
Contributor

m-aciek commented Dec 28, 2024

Probably sorting alphabetically by English names and translating would be optimal to keep the best user experience.

translating

As far as I'm concerned the switcher is not part of the theme, so we would need a new translation project/entrypoint (we can't integrate it easily with theme translations) unless would like to use some third party library that provides language name translations.

Sorting and translating seem somewhat separate, maybe we could create a separate issue for translating?

@StanFromIreland
Copy link
Contributor Author

@m-aciek I will convert this issue to just translating. As it seems there is not much left to discuss about sorting.

@StanFromIreland StanFromIreland changed the title Reorder/Rename Switcher Translate Switcher Dec 29, 2024
@JulienPalard
Copy link
Member

I don't get the idea of translating all the languages on the switcher. As an example: I can read french and english, but not chinese / japanese / korean. If I land on a CJK page, if the language switchers displays me a list like: 한국어 how would I be able to switch back to a language I understand?

@StanFromIreland
Copy link
Contributor Author

@JulienPalard I'm not exactly sure what @AA-Turner meant but I think all languages should be in their native for example if I only speak Polish then I wouldn't know what "Polish" is as it is "Polski" in Polish.

@hugovk
Copy link
Member

hugovk commented Dec 29, 2024

Yes, so we'd show something like this:

  • English
  • Français
  • Polski

Or perhaps include English and the native name:

  • English
  • French / Français
  • Polish / Polski

And use the same list for every translation's switcher.

@StanFromIreland
Copy link
Contributor Author

@hugovk

From my understanding simply changing the names in the config should work, correct? I can research the names and open a PR.

@hugovk
Copy link
Member

hugovk commented Jan 24, 2025

I expect so, but nothing's ever simple ;)

Which of the two options do people prefer: just native name, or English + native?

@StanFromIreland
Copy link
Contributor Author

I think just native is fine. That is the standard most websites use (all alphabet and microsoft products for example)

@encukou
Copy link
Member

encukou commented Jan 24, 2025

IMO, readers need:

  • the language they want to switch to. For this, we only need the native name -- why would switch to a language you don't know? A French-only reader does not need to switch to Anglais.
  • where on the page the language switcher is -- especially if you don't know the language the page is in. Here, the English names help English speakers (and similar -- language names are more recognizable than most words). That's arguably most of our current user base, but not necessarily what we want to limit it to.

English names make alphabetical sorting possible, which makes finding your language easier if you know its English name. Which you most likely do even if you don't speak English.
So, I'd go for French / Français. (Note that the first name is in English, not “the language of the page”. And English comes first so that it's obvious that it's the sort key.)


From the examples in the first post, I like Google's icon:

Image

If you land on a page in an unfamiliar language (or ever writing system), that's what you look for.

Wikipedia has one that's more correct (it's about writing, not geography) but less recognizable:

Image

(UN's page works well but it's only a language switcher; cppreference looks like they just used a default.)

@StanFromIreland
Copy link
Contributor Author

I like the icon idea but that would require work on the python-docs-theme side. And now we have three options! (Hopefully it won't extend any further.

  1. EnglishName
  2. vernacularName (EnglishName)
  3. EnglishName (vernacularName)

GitHub does not have a voting method so I propose:
Thumbs Up for 1
Thumbs Down for 2
Smiling Face for 3

@m-aciek
Copy link
Contributor

m-aciek commented Jan 24, 2025

@encukou suggested using slash as a separator, instead of brackets. I propose to vote below:

  1. thumbs up for slash /
  2. thumbs down for brackets ( )

(An entry with a slash is slightly shorter in width than brackets). Regarding the order, in my opinion with English name first it would be easier to visually find the language having the latin script and entries ordered alphabetically by English name, especially when the list will grow further.

@encukou
Copy link
Member

encukou commented Jan 24, 2025

My opinion on that depends on the order:

  • localName (EnglishName) -- IMO, the English name is not very important here
  • EnglishName / localName -- localName is the important part, it shouldn't be de-emphasized. English is only first to make it obvious that it's the sort key.

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

6 participants