Teifun2 / nextcloud-cookbook-flutter

Flutter Project for the nextcloud plugin "cookbook"
Creative Commons Zero v1.0 Universal
103 stars 25 forks source link

intl for localization #187

Open Leptopoda opened 1 year ago

Leptopoda commented 1 year ago

I was thinking of switching the translation over to the intl package as it is the recommended way for flutter apps.

I've worked with it a many times and I quite like the code generation and the safety that all invocations will work. It also has good pluralization support that the current flutter_translate package also recently added and we maybe can't use because we sit on an older downstream branch.

Sadly I have no idea how transifex handles the arb files or if it even supports them. In general arb files are just json files with some cool extra metadata features so we might be able to just convert it.

It'd be great if someone could verify that.


More information on the recommended flutter translation flow can be found here: https://docs.flutter.dev/development/accessibility-and-localization/internationalization

Teifun2 commented 1 year ago

I dont find the .arb files as supported file format of transifex :S https://help.transifex.com/en/collections/3511306-for-developers#file-formats

I dont really remember why i used the special library, but at that time it was somehow the option that pleased me the most.

We could also check to update the downstream branch of flutter_translate. It is only used because it has the fallback language. Which is not supported in the main repo for reasons i cannot understand.

(If strings are not available in given langauge they are just representet with the keys. But i want it to default to english)

Leptopoda commented 1 year ago

how does the transifex bot work regarding new string?

Will it pick them up as soon as I merge a change to the english translation into develop?