angular-localization
angular-localization copied to clipboard
Incremental and hierarchical fallback
This supports three levels of fallback. The requested locale, falling back to the fallback locale and then the default. This allows incremental localisation files, so, for example, you can have de-CH as a swiss localisation with just a few Swiss phrases, over-riding de-DE for the main German language localisation, and then the fallback of en-US for anything not in these files.
This builds the hierarchical locale list in the setLocale method then it loads all files when they are first requested to avoid any issues later.
This PR also includes #38 which adds locale names to the configuration list.
(#30)
I've updated this PR to merge your latest changes and resolve the conflicts. I've also fixed a small bug in the fallback routine associated with resolving all the promises as the deferred path previously didn't include the locale which meant that resolving the promise didn't work correctly.
I've also fixed the fallback tests and added some new test cases.
+1