Skip to content

Allow locale to be a list#32

Open
benjaminwinger wants to merge 1 commit into
kikito:masterfrom
benjaminwinger:fallback-chains
Open

Allow locale to be a list#32
benjaminwinger wants to merge 1 commit into
kikito:masterfrom
benjaminwinger:fallback-chains

Conversation

@benjaminwinger

Copy link
Copy Markdown

This allows an arbitrary-length of fallback chain for the user-requested locale, letting users provide multiple preferred languages instead of just one.

@benjaminwinger benjaminwinger force-pushed the fallback-chains branch 2 times, most recently from 3a34e20 to 5a41912 Compare February 1, 2022 22:53
This allows an arbitrary-length of fallback chain for the user-requested
locale.
@benjaminwinger

Copy link
Copy Markdown
Author

Updated to include tests.

Note that I removed the following test, as there doesn't seem to be a meaningful result for it with arbitrary length fallback chains, and I'm not sure that it's necessary in the first place (en should generally only contain messages which are shared between the country-specific locales, and users should usually request a country-specific locale).

it("returns the fallbackLocale ancestry if locale is parent of fallbackLocale", function()
     assert.same(variants.fallbacks('en','en-US'), {'en-US', 'en'})
end)

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

Successfully merging this pull request may close these issues.

1 participant