This repository has been archived by the owner on May 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Add selectordinal
support and improve locale data
#102
Merged
Conversation
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
This upgrades to intl-messageformat-parser@1.1.0 and adds support for `selectordinal` arguments; e.g.: ``` This is my {year, selectordinal, one {#st} two {#nd} few {#rd} other{#th} } birthday. ``` The locale data has also been vastly improved in the following ways: * Added `pt-PT` plural rule function, which differs from `pt`'s. * Properly de-duplicate data for all CLDR locales by correctly traversing a locale's hierarchy of ancestor locales. * Added data for the following languages: aa, agq, bas, bh, ckb, dav, dje, dsb, dua, dv, dyo, ebu, ewo, guw, guz, hsb, ia, in, iu, iw, jbo, ji, jv, jw, kaj, kam, kcg, khq, ki, kln, kok, ksf, ku, lb, lu, luo, luy, mer, mfe, mgh, mo, mua, nah, nmg, no, nqo, nus, ny, pap, prg, qu, rn, rw, sbp, sh, sma, smi, smj, smn, sms, swc, syr, tk, tl, twq, vai, wa, wo, yav, yi, zgh ---- These changes also include improvements for how locales are resolved. Here are some details of these changes: * If no extra locale data is loaded, the locale will _always_ resolved to `en`. * If locale data is missing for a leaf locale like `fr-FR`, but there _is_ data for the root, `fr` in this case, then its root will be used. * If there's data for the specified locale, then that locale will be resolved; i.e., var mf = new IntlMessageFormat('', 'en-US'); assert(mf.resolvedOptions().locale === 'en-US'); // true * The resolved locales are now normalized; e.g., `en-us` will resolve to: `en-US`. Fixes formatjs#84
CLA is valid! |
Note: This PR does not include the |
This was referenced Mar 6, 2015
Closed
🚀 |
@jasonmit Did you want to review this? |
LGTM 👍 |
ericf
added a commit
that referenced
this pull request
Mar 9, 2015
Add `selectordinal` support and improve locale data
The new plural rule functions generated via make-plural use See: eemeli/make-plural#5 |
I fixed make-plural to use As a heads-up, I'm working on migrating the make-plural codebase to ES6, and will be eventually publishing that as v2.2 or v3. The idea is to use Babel to transpile it to ES5, and still publish a version using |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This upgrades to
intl-messageformat-parser@1.1.0
and adds support forselectordinal
arguments; e.g.:The locale data has also been vastly improved in the following ways:
pt-PT
plural rule function, which differs frompt
's.aa, agq, bas, bh, ckb, dav, dje, dsb, dua, dv, dyo, ebu, ewo, guw, guz, hsb, ia, in, iu, iw, jbo, ji, jv, jw, kaj, kam, kcg, khq, ki, kln, kok, ksf, ku, lb, lu, luo, luy, mer, mfe, mgh, mo, mua, nah, nmg, no, nqo, nus, ny, pap, prg, qu, rn, rw, sbp, sh, sma, smi, smj, smn, sms, swc, syr, tk, tl, twq, vai, wa, wo, yav, yi, zgh
These changes also include improvements for how locales are resolved. Here are some details of these changes:
If no extra locale data is loaded, the locale will always resolved to
en
.If locale data is missing for a leaf locale like
fr-FR
, but there is data for the root,fr
in this case, then its root will be used.If there's data for the specified locale, then that locale will be resolved; i.e.,
The resolved locales are now normalized; e.g.,
en-us
will resolve to:en-US
.Fixes #84