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

Fix for loading country specific languages codes #849

Merged
merged 4 commits into from
Jun 7, 2018

Conversation

lyralemos
Copy link
Contributor

@lyralemos lyralemos commented May 25, 2018

With this fix, country specific language codes are correctly loaded. Fixes plone/Products.CMFPlone#949

As language codes are obtained via lang property in the html tag, there is an inconsistency with Plone locales code base. For instance, Brazilian Portuguese lang attribute is pt-br, but in plone locales is referred to as pt_BR.

This code does a simple transformation on the language code so that correct translations are loaded.

@davilima6
Copy link
Member

@lyralemos will sign and send over the Contributor Agreement today. Thanks! (also kudos to @claytonc who initially helped with the solution=)

Copy link
Member

@agitator agitator left a comment

Choose a reason for hiding this comment

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

lgtm

@lyralemos
Copy link
Contributor Author

I've already signed the agreement.
Code was committed using a different e-mail which I just added to my GitHub account.

@davilima6
Copy link
Member

I'd squash all commits before merge.

@thet
Copy link
Member

thet commented Jun 7, 2018

LGTM

@thet thet merged commit ff6747a into plone:master Jun 7, 2018
@gforcada
Copy link
Member

@lyralemos @thet when this got merged Jenkins started failing on the JavaScript job: https://jenkins.plone.org/job/plone-5.1-js/ any idea why the tinymce tests fail?

@lyralemos
Copy link
Contributor Author

I've managed to run the tests locally and realized were the problem is.
For some reason tests are falling if I don't check if currentLanguage is different that en-us.

Should I create a new PR? Or can I still commit changes here?

@gforcada
Copy link
Member

@lyralemos a new pull request would be best, thanks for having a quick look at it!!

@lyralemos lyralemos mentioned this pull request Jun 15, 2018
petschki added a commit that referenced this pull request Jun 28, 2018
due to a issue in country specific language handling introduced in #849
tdesvenain pushed a commit to makinacorpus/mockup that referenced this pull request Aug 14, 2018
due to a issue in country specific language handling introduced in plone#849
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.

Missing language related resources
6 participants