Bug 417867

Summary: Add support for flutter/dart "arb" file format
Product: [Applications] lokalize Reporter: Mayeul C. <oss+kde+bugzilla>
Component: generalAssignee: Simon Depiets <sdepiets>
Status: REPORTED ---    
Severity: wishlist CC: shafff
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mayeul C. 2020-02-19 10:31:10 UTC
SUMMARY
It looks like google's new language/framework uses an "arb" file format in place of po files.

I am not too familiar with it, but they look like plain json files, and would like to be able to use lokalize to edit them. I'd be happy with a barebones implementation for now, although the file format doesn't seem overly complex.

The specification is available over there:
https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification

Here is a tutorial with the expected workflow, a possible application, and a few syntax examples: https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-flutter-apps

As an example, the file I attempted to translate is this one, it makes for a real-life example:
https://gitlab.com/ChristianPauly/fluffychat-flutter/-/blob/9a52e938628df3c35e2cf7a2af6e33cdb5a0f6ed/lib/i18n/intl_messages.arb

A german-translated one sits in the same folder:
https://gitlab.com/ChristianPauly/fluffychat-flutter/-/blob/9a52e938628df3c35e2cf7a2af6e33cdb5a0f6ed/lib/i18n/intl_de.arb

As well as instruction in that repository's readme:
https://gitlab.com/ChristianPauly/fluffychat-flutter/-/blob/9a52e938628df3c35e2cf7a2af6e33cdb5a0f6ed/README.md#how-to-add-translations-for-your-language

A mime type should probably be created as well, but that can be done independently.
Comment 1 Mayeul C. 2020-02-19 10:39:23 UTC
I also created a feature request for gtranslator to support this: https://gitlab.gnome.org/GNOME/gtranslator/issues/102
Comment 2 Simon Depiets 2020-02-19 10:41:09 UTC
The format makes it ill-suited to work with lokalize, each file only contains the current language, it's very different from a po file which contains both the source and the target language.