Skip to content

Instantly share code, notes, and snippets.

@rxaviers
Created January 28, 2016 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rxaviers/ee2d02719b4eb1dc0284 to your computer and use it in GitHub Desktop.
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
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