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

i18nUtils: accept 3-letter locale slugs #3177

Merged
merged 1 commit into from
Feb 9, 2016

Conversation

deBhal
Copy link
Contributor

@deBhal deBhal commented Feb 9, 2016

This PR fixes #3175, by updating the regex filter in i18nUtils.getLanguage() to accept locales with three-letter slugs.

If you run config('languages').forEach( (lang) => i18nUtils.getLanguage( lang.langSlug ) ? null : console.log(lang.name) ) (e.g. by adding it to the bottom of client/lib/i18n-utils/utils.js and calling make test) you see a list of languages that occur in the config but return null from getLanguage():

als - Alemannisch
arc - ܕܥܒܪܸܝܛ
ast - Asturianu
csb - Kaszëbsczi
fil - Filipino
fur - Furlan
ilo - Ilokano
mwl - Mirandés
nah - Nahuatl
nap - Nnapulitano
nds - Plattdüütsch
non - Norrǿna
rup - Armãneashce
tir - ትግርኛ
udm - Удмурт
vec - Vèneto
xal - Хальмг

These languages all have 3 letter slugs, so I've updated the filter in i18n-utils to allow them and added a test for one of them.

@deBhal deBhal added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. i18n labels Feb 9, 2016
@deBhal deBhal self-assigned this Feb 9, 2016
@yoavf
Copy link
Contributor

yoavf commented Feb 9, 2016

👍

@yoavf yoavf added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 9, 2016
deBhal added a commit that referenced this pull request Feb 9, 2016
…rning-some-languages

i18nUtils: accept 3-letter locale slugs
@deBhal deBhal merged commit fed9774 into master Feb 9, 2016
@deBhal deBhal deleted the fix/3175-i18n-utils-not-returning-some-languages branch February 9, 2016 09:31
@oskosk oskosk mentioned this pull request Mar 3, 2016
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

i18n.getLanguage() and config( 'languages' ) are inconsistent
3 participants