urania-dev / snapp

Yet Another Url Shortner. A simple excercise to learn Svelte.
https://snapp.li
MIT License
176 stars 10 forks source link

Add new language #48

Open xja opened 7 hours ago

xja commented 7 hours ago

How should I add a new language to the project? I put the translated file under src/lib/i18n/locales, and added an entry in src/lib/i18n/index.ts, after building using docker build, there is no this new language option showing in the settings page.

087407f0082e7171e1ac6e12247d027f50d97532

xja commented 4 hours ago

Sorry, I forgot to change the remote url before building. The new language can be selected and applied in settings page now. But there are two problems related still:

  1. It shows "Cn" instead of "Simplified Chinese" in the language drop down list
  2. All the drop down list boxes are editable on my Android Firefox, making it annoying while trying to select an item because the keyboard would appear
urania-dev commented 47 minutes ago

Languages were translate automatically from the I18N short id, for chinese should work zh if im not wrong.

Also typing can be deactivated, and since there are not that many languages I could actually disable it there.

Edit: you can also add new languages without removing others :)