EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

How to get the current locale name in the angular component? #54

Closed Stanteq closed 5 years ago

Stanteq commented 5 years ago

Hi.

How to get the current locale name in the angular component like: en, de etc?

For the moment as a workaround i placed on each translation file a key:

{"LOCALE":"en"} 
... 
{"LOCALE":"de"}  
...

which is translated in current language but should be a more intelligent way i think.

lfabreges commented 5 years ago

That's a great workaround. Otherwise you'll have to use native API to retrieve the current language.