sufone / layl

🌙 Calculator for tahajjud, qiyam, and worship & sleep in an Islamic night!
https://layl.app
GNU Affero General Public License v3.0
21 stars 3 forks source link

Store language preference and load that next time #37

Closed mr-islam closed 3 years ago

mr-islam commented 3 years ago

Basically, set a local storage item for user chosen langauge whenever $locale changes (for any reason, most likely language picker dropdown)

And load that as the first choice in the i18n.js init options, with fetching the navigator as a fallback (for first time visitors)

mr-islam commented 3 years ago

Really loved the example from svelte-i18n, makes life so easy: https://github.com/kaisermann/sapper-template-i18n/blob/master/src/i18n.js