kas-catholic / confessit-web

Source code for https://confessit.app
MIT License
18 stars 8 forks source link

Add a language switcher #13

Closed kas-catholic closed 1 year ago

kas-catholic commented 2 years ago

Adds a language switcher to change the locale. We'll wait to merge this 'til we have at least 2 well-supported languages.

Note that language names are intentionally untranslated - they should always be in the native locale.

Fixes #6.

JohnRDOrazio commented 2 years ago

I have started integration of the language files with my weblate instance: https://translate.johnromanodorazio.com/engage/confessit-web/

You can add a widget to the repo README if you like, which can show the current state of translations: https://translate.johnromanodorazio.com/widgets/confessit-web/

In order for the weblate instance to pick up automatically any changes to the English language source file, you can add a web hook to the repository: https://docs.weblate.org/en/weblate-4.9.1/admin/continuous.html#github-setup

Specifically: repository settings -> webhooks -> 'Add webhook Underpayload urlputhttps://translate.johnromanodorazio.com/hooks/github/. Forcontent typechooseapplication/x-www-form-urlencoded. Forwhich events will trigger this hookchoosejust the push event. Then click on theactivecheckbox, and save with theAdd webhook` button.

mkasberg commented 2 years ago

@JohnRDOrazio The webhook should be set up! Thanks!

netlify[bot] commented 2 years ago

Deploy Preview for confessit-web ready!

Name Link
Latest commit 69bc46b9b78a32e35e0848a63041826d258d1baf
Latest deploy log https://app.netlify.com/sites/confessit-web/deploys/64570ed59ec9a2000982912f
Deploy Preview https://deploy-preview-13--confessit-web.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

evang522 commented 1 year ago

I would actually suggest that it's worth it to go ahead and add this. Let me illustrate my use-case: my android phone is German locale. I've been working on helping to add German translations, but of course it takes time. Now, however, when the app loads, the incomplete German version is loading since it detects my phone's locale, and I can barely use the app on my phone anymore.

Having the ability to switch at least to english would be really nice :)

kas-catholic commented 1 year ago

Thanks for the suggestion!

I'm doing a couple things that should make this situation better:

Can I make one request? Prioritizing the translation of these strings (German is the only language that's missing them) will make it clear how anyone else can contribute if they notice the missing strings: https://github.com/kas-catholic/confessit-web/blob/76d57321503e1f43551c08868cf6d139d609e781/public/locales/de/translation.json#L61-L62