Created
January 28, 2016 12:42
-
-
Save rxaviers/ee2d02719b4eb1dc0284 to your computer and use it in GitHub Desktop.
Testing Intl.Locale API draft zbraniecki:locale-api https://github.com/tc39/ecma402/compare/master...zbraniecki:locale-api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intl.getParentLocales('en-IN'); | |
// ['en-IN', 'en'] (wrong, it ignores parent locale 'en-001') | |
// Expected ['en-IN', 'en-001', 'en', 'root']. | |
// see http://www.unicode.org/reports/tr35/#Parent_Locales | |
Intl.getParentLocales('zh-TW'); | |
// ['zh-TW', 'zh'] (wrong, it should begin at 'zh-Hant', note 'zh' is the default bundle for a diff script 'zh-Hans'). | |
// Expected ['zh-Hant', 'root']. | |
Intl.getParentLocales('zh'); | |
// ['zh'] (wrong) | |
// Expected ['zh-Hans', 'zh', 'root']. | |
Intl.getParentLocales('sr'); | |
// ['sr'] (wrong) | |
// Expected ['sr-Cyrl', 'sr', 'root']. | |
// More tests | |
// https://github.com/rxaviers/ecma402-fix-lookup-matcher#impact | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment