angular-localization icon indicating copy to clipboard operation
angular-localization copied to clipboard

Incremental and hierarchical fallback

Open cdjackson opened this issue 10 years ago • 2 comments

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)

Review on Reviewable

cdjackson avatar Mar 14 '15 19:03 cdjackson

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.

cdjackson avatar May 03 '15 12:05 cdjackson

+1

ssj3sunny avatar Jun 28 '16 17:06 ssj3sunny