urania-dev / snapp

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

Add new language #48

Closed xja closed 2 months ago

xja commented 2 months 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 2 months 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 2 months 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 :)

urania-dev commented 2 months ago

I took the liberty of taking your translation and add it to the next version i'm building. it also fixes the combo-box on mobile, deactivating the input field in order to better manage the choose :)

edit: and it is live, try it and let me know! :)

xja commented 2 months ago

OK. Just to let you know, the translation was done using the free Perplexity.ai. I checked it over and fixed any mistakes, but can't guarantee the translations are 100% perfect or ideal.

urania-dev commented 2 months ago

Well, for sure is better of what i could ever do. :) Thank you!