martinandert / counterpart

A translation and localization library for Node.js and the browser.
MIT License
242 stars 25 forks source link

Allow multiple fallback locales #40

Closed takakoshimizu closed 7 years ago

takakoshimizu commented 7 years ago

This change involves allowing multiple fallback locales to be specified and tried sequentially. Our use case requires us to have the following sort of setup:

fr-ca -> fr -> en

This necessitates more than one fallback locale.

Existing tests pass with minor modifications (ie no fallback locale is now an empty array rather than null), and new tests have been added for the new functionality.

martinandert commented 7 years ago

Perfect, thanks! I've just released v0.17.7 which includes your feature. Enjoy!