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

Language Variant File Names should be aligned with ISO 3166 #869

Closed
vanthome opened this issue Jun 29, 2013 · 4 comments
Closed

Language Variant File Names should be aligned with ISO 3166 #869

vanthome opened this issue Jun 29, 2013 · 4 comments

Comments

@vanthome
Copy link

This ISO standard defines country codes in capitals:
http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Also this standard defines language tags in the form de-AT or en-GB etc.
http://en.wikipedia.org/wiki/IETF_language_tag

Therefore, I think the files in the lang folder should be renamed to mach this form.
Currently we have en-gb.js but this should be en-GB.js

@ichernev
Copy link
Contributor

@timrwood there was a discussion about that some time ago, but I can't dig it up. What was your stand?

@timrwood
Copy link
Member

I think we should treat language identifiers as being case insensitive and replace _s with -s.

While language codes should technically have capitalized modifiers, it makes it easier for node to require languages in a consistent naming pattern.

For reference, here are some examples of different valid language identifiers from CLDR.

http://unicode.org/cldr/utility/languageid.jsp

en
eng-840
pt_PT
AZ-arab-Ir
zh-Hant-HK
en-cmn-Hant-HK
sl-Cyrl-YU-rozaj-solba-1994-b-1234-a-Foobar-x-b-1234-a-Foobar

I opened an issue at #963 to track this as well.

@icambron
Copy link
Member

Fixed by #985. All of these are now accepted:

moment.lang('en-gb');
moment.lang('en-GB');
moment.lang('en_GB');
moment.lang('EN_GB');

@mattjohnsonpint
Copy link
Contributor

nice!

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

No branches or pull requests

5 participants