Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Multiple L10N fixes #1558

Merged
merged 1 commit into from
Dec 15, 2016
Merged

Multiple L10N fixes #1558

merged 1 commit into from
Dec 15, 2016

Conversation

johngian
Copy link
Contributor

@johngian johngian commented Dec 1, 2016

  • Exclude /api and /admin URLs from L10N middleware.
  • Fix LANGUAGES definition format.
  • Use regex for URLs that are not to be localized.

Copy link
Contributor

@akatsoulas akatsoulas left a comment

Choose a reason for hiding this comment

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

r+

'^/oidc/authenticate/',
'^/oidc/callback/',
'^/api/v2/',
'^/admin/'
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add /api/v1 here too.

@johngian
Copy link
Contributor Author

johngian commented Dec 1, 2016

We should also fix LANGUAGES references that handle languages as dict.

@@ -118,11 +120,11 @@ def get_langs():
def lazy_langs():
from product_details import product_details

return dict([(lang.lower(), product_details.languages[lang]['native'])
for lang in get_langs() if lang in product_details.languages])
return [(lang.lower(), product_details.languages[lang]['native'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, what's the reason for this change? If this is not something relevant to this PR, please revert the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are changing this because of the way Puente works. It tries to get closer to how django internal l10n support works.

https://docs.djangoproject.com/en/1.10/ref/settings/#languages

* Exclude /api and /admin URLs from L10N middleware.
* Fix LANGUAGES definition format.
* Use regex for URLs that are not to be localized.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 93.124% when pulling d395fbc on johngian:l10n-fixes into b0fcf0a on mozilla:master.

@johngian johngian merged commit a029536 into mozilla:master Dec 15, 2016
@johngian johngian deleted the l10n-fixes branch December 15, 2016 15:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants