Glimesh / glimesh_app

The official Glimesh Mobile App.
https://glimesh.tv/about/app
MIT License
10 stars 5 forks source link

Add i18n to app #42

Open clone1018 opened 2 years ago

clone1018 commented 2 years ago

Right now the app is only available in English. If we can reuse the po files generated for the main website, we can offer i18n pretty easily inside of the app.

Example: https://github.com/Glimesh/glimesh.tv/blob/dev/priv/gettext/pt_br/LC_MESSAGES/default.po

ponkey364 commented 2 years ago

Looks like there's a library someone wrote for doing this: https://pub.dev/packages/gettext_i18n, been having a play around today and it's working nicely, however I'm not sure how we handle the (few) strings that are in the app and not in the main website or are different between the two?

clone1018 commented 2 years ago

however I'm not sure how we handle the (few) strings that are in the app and not in the main website or are different between the two?

I guess I was hoping we could modify all the text in the app to be the same as on the website. This solution wont scale forever, but for now it should work given the parallels between the two platforms.

ponkey364 commented 2 years ago

yeah, there's a few places locally where I've done that, do you want me to push a branch so you can have a look?

clone1018 commented 2 years ago

Sounds good to me!

ponkey364 commented 2 years ago

pushed to the ponkey-test-i18n branch

clone1018 commented 2 years ago

Looks super straightforward!

clone1018 commented 2 years ago

@ponkey364 want to turn this into a PR?

ponkey364 commented 2 years ago

yeah sure, will tidy it up a bit and wrap everything (not just the strings that exist in the PO files) in context.t. Would it be possible to get the translations synced between POEditor and the glimesh.tv repo so I can make sure we start with an up to date version?

Also, which languages should we include?

(will probably do this at the weekend)

clone1018 commented 2 years ago

Would it be possible to get the translations synced between POEditor and the glimesh.tv repo so I can make sure we start with an up to date version?

Wonder if we can submodule the i18n file from Glimesh? I would assume all languages we include on the regular website, but we can always start with English and Spanish if that makes sense to test.

clone1018 commented 2 years ago

We'll need some kind of selector unless we rely on system language too.

ponkey364 commented 2 years ago

Wonder if we can submodule the i18n file from Glimesh? I would assume all languages we include on the regular website, but we can always start with English and Spanish if that makes sense to test.

I'll try the submoduling, I think that's the best idea. I'll set it up to be all the languages we currently support, although we have at least one that Flutter doesn't support, so I'll exclude that.

We'll need some kind of selector unless we rely on system language too.

Yeah, I was thinking we do both: use the system language, but allow the user to override it in our settings menu?