Repository navigation
Conversation
Contributor
|
Thank you, this is correct and the tests are exactly the right ones. I decided to fix it one level further back in f10f824, by making :und a supported locale whether or not it is configured, which also covers validate_locale("und") outside the parent walk and clears RBNF’s cached chains when the supported set changes. Your test cases are in Thank you again, much appreciated. Localize 1.5.0 will be out in the next 24 hours, including this fix. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the English fallback reported in #68.
Locale.parent/1builds the root tag withcldr_locale_id: :und, thenwith_cldr_locale_id/1validates"und"again. When:undisn't a supported locale, that validation resolves it to the default locale, so every parent chain ended at:eninstead of:und. As a result, RBNF'sreject_und_spellout_stub/3never saw root, and English answered for any spellout rule set the locale lacked. For example,Rbnf.to_string(2_000_000, :spellout_cardinal, locale: :ru)returned"two million".with_cldr_locale_id/1now keeps root as:und, the same waycldr_locale_id_from/1already resolves a bare root tag.The new tests in
supported_locales_test.exsremove:undfrom the supported locales. They check that parent chains still end at:und, and that therurequest returnsUnknownRbnfRuleError. Both fail onmain. The RBNF test erases the cachedruchain first, becauseput_supported_locales/1doesn't clear it.This doesn't change the
nb/noquestion in #68.