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

Use full regional locale in Dashboard #13363

Merged
merged 5 commits into from Feb 23, 2017
Merged

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Feb 22, 2017

For a while now, we've been unable to fully internationalize all regional variants of our languages in Dashboard; for a (minor but easy to see) example, look at the Privacy Policy link at the bottom of the page https://studio.code.org/; note that in Brazilian Portuguese the text of the link is capitalized, but it is not so in Portuguese Portuguese. However, if you toggle between the two languages on the page, you'll notice that we always show the Brazilian version.

This is because we are for some reason lowercasing all locales in dashboard even though we store the actual data in the format "en-US", with the regional part capitalized. This means that when you switch the dialect to Portugal Portuguese, we tell dashboard to switch the locale to "pt-PT" and dashboard instead switches the locale to "pt-pt". Then when we ask it to look up a translation, it goes and looks for "pt-pt" and can't find it because we only have "pt-PT", so it just defaults back to the base language "pt", for which the default region is "BR" (or "br").

The simple solution is to just stop lowercasing the locale.

image

@Hamms Hamms force-pushed the dashboard-use-regional-locale branch from 881a5da to 87bc076 Compare February 22, 2017 01:09
@Hamms Hamms changed the title [WIP] Use full regional locale in Dashboard Use full regional locale in Dashboard Feb 22, 2017
Copy link
Contributor

@tanyaparker tanyaparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't believe it. Fingers crossed we don't start any fires.

Copy link
Contributor

@joshlory joshlory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find!

clap

@Hamms Hamms merged commit e8eeab6 into staging Feb 23, 2017
@Hamms Hamms deleted the dashboard-use-regional-locale branch February 23, 2017 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants