Assembless / react-littera

🌐 Modern react library for managing translations.
MIT License
19 stars 1 forks source link

Automatically detect language #6

Closed DRFR0ST closed 4 years ago

DRFR0ST commented 5 years ago

It would make it easier for the developer, if Littera would auto detect the language without the need to provide an initial language.

The language is stored in navigator.language, we just need to parse it to our format (from en-US to en_US etc.) and check if the language is supported by the setup.

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language

DRFR0ST commented 4 years ago

Will be implemented with #7 :tada: