Skip to content

Prevent overwriting default with a translation #194

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pseudoacacial
Copy link

@pseudoacacial pseudoacacial commented Jan 1, 2025

Hi :)

In some cases, the default (en-US) language version is being overwritten by a translation - instead of setting the language to user's language in the Options dropdown, the 'English (US) version is being replaced with the user's language.

Here's a screenshot of how that situation looked for me:
description of the problem

This situation seems to not be desired, as now the English translation is not accessible - in the case from the screenshot, both English and Polish options show a Polish translation, with no way to show the English version. This can easily lead to the user not being able to access a version of the site understandable to them, if the user's preferred language has not been recognized correctly.

In my particular case:

  • the language in which i wished to view the site was English
  • my system locale was en-US
  • my preferred languages set in the browser (firefox) were, in order: en, en-US, pl

In my case the site was exhibiting the behavior described above - English version was replaced with Polish, with no way to access the English version.
Removing Polish from the list of my languages in firefox made the site show up correctly in English.

This pull request fixes the issue by adding an English language file. With this fix, in my case, the English language option is no longer being overwritten.
In case where the translation is actually needed (it is set in locale) already existing code changes the value of the language selection to user locale.

There is a very similar pull request open (#188), which has not been merged, i assume due to not explaining why it is needed.

@pseudoacacial
Copy link
Author

This can also be fixed by my proposed change to react-t
wojtekmaj/react-t#99

@pseudoacacial
Copy link
Author

formatting fixed, sorry

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

Successfully merging this pull request may close these issues.

1 participant