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

Language switcher #4366

Merged
merged 3 commits into from
Oct 10, 2023
Merged

Language switcher #4366

merged 3 commits into from
Oct 10, 2023

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Oct 3, 2023

Issue: AAH-2730; discord

This adds a language switcher to standalone navbar:

closed
20231003034056

opened, using browser default language
20231003033955

manualy switched
20231003034013

manually switched back
20231003034039

(reset to browser defaults leads back to second screenshot :))

(the (current), (browser default) and Reset to browser defaults strings would be translated once we have the right strings in the catalog)

This uses the language-switching mechanism introduced in #3225, updating it to not pass ?lang to API calls.

@himdel himdel marked this pull request as draft October 3, 2023 03:41
@github-actions github-actions bot added backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) labels Oct 3, 2023
@himdel himdel added community comunity mode feature and removed backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) labels Oct 3, 2023
@himdel
Copy link
Collaborator Author

himdel commented Oct 3, 2023

options:

  • use translated language names ("English, Spanish" & "Ingles, Espanol")
  • use original language names ("English, Espanol")
  • use flag emojis ("🇬🇧, 🇪🇸") (possibly problematic for languages used in multiple countries)
  • ISO 639-1 ("en", "es")

@felixfontein
Copy link
Contributor

  • use translated language names ("English, Spanish" & "Ingles, Espanol")
  • use original language names ("English, Espanol")

I would use the original language names. The chance that someone figures out that this is the language selector and finds a language they understand is a lot higher if they can at least read the names of the languages they understand :)

(Just think of the UI being in a language and script you do not know, and you cannot even recognize one single language name since they are all in an unknown script. For example look at https://www.wikidata.org/wiki/Q1860#sitelinks-wikipedia and see in how many of the languages you can recognize that the article is about the English language :) )

  • use flag emojis ("🇬🇧, 🇪🇸") (possibly problematic for languages used in multiple countries)

Using flag emojis is a huge antipattern. There are countries with multiple languages (Canada, Switzerland, ...), and as you mentioned there are languages that are used in multiple countries (English, French, Spanish, German, ...).

You can find some concrete examples here: https://www.flagsarenotlanguages.com/blog/why-flags-do-not-represent-language/

  • ISO 639-1 ("en", "es")

That would work, but it looks a bit ugly ;-) What you can always do is add the ISO 639-1 code in brackets next to the language name (like English (EN)) - then you can even translate the language name without causing too many headaches (though mostly only because this site has a technical audience - I would still stick to untranslated language names).

@himdel
Copy link
Collaborator Author

himdel commented Oct 9, 2023

Updated to use original language names

20231009115239

and made sure the language param gets applied and removed consistently.

@himdel himdel marked this pull request as ready for review October 9, 2023 12:28
Issue: AAH-2730
language - always
docs - not on login screen
user - logged in, not anonymous
login - not logged in, or anonymous
@himdel himdel merged commit 8c73db2 into ansible:master Oct 10, 2023
16 of 18 checks passed
@himdel himdel deleted the lang-switcher branch October 10, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community comunity mode feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants