sledilnik / mobile-app

Mobile application for latest sledilnik data
GNU Affero General Public License v3.0
4 stars 2 forks source link

Set internationalization mechanism #7

Closed MihaMarkic closed 3 years ago

MihaMarkic commented 3 years ago

We have to put up a proper internationalization mechanism and provide strings and formatting through it. Number and date formating already uses it though the locale is hardcoded for now.

stefanb commented 3 years ago

We can use Weblate for translations: https://docs.weblate.org/en/latest/formats.html#aresource

MihaMarkic commented 3 years ago

I guess whatever tool that generates i10n, right? I will set up flutter stuff for consuming it.

stefanb commented 3 years ago

Otoh flutter seems to have it a bit differently: https://flutter.dev/docs/development/accessibility-and-localization/internationalization

But we can also use Weblate for .arb files https://docs.weblate.org/en/latest/formats.html#arb

MihaMarkic commented 3 years ago

@stefanb Version that has localization at its core is now in main branch, also updated readme. Can you give it a try with Weblate?

stefanb commented 3 years ago

Weblate project configured: https://hosted.weblate.org/projects/sledilnik/mobile-app/

Base language is english, so make sure to add the strings at least into sledilnik_mobile_app/lib/l10n/app_en.arb.

Webhook is configured, so changes in the git repo should come to weblate immediately. Changes from weblate will be committed and pushed to git an hour after the last change, so that not every change has its own commit.

You can use your GitHub account or create login on Weblate, or make sure that your Weblate account has one of the email addresses you have in your GitHub profile, so your contributions are attributed properly.

stefanb commented 3 years ago

FYI, the app is always shown in slovenian

MihaMarkic commented 3 years ago

@stefanb yep, always in Slovene for now. It needs a page to select the language and automatic language selection upon start based on OS settings.