Bug 417867 - Add support for flutter/dart "arb" file format
Summary: Add support for flutter/dart "arb" file format
Status: REPORTED
Alias: None
Product: lokalize
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-19 10:31 UTC by Mayeul C.
Modified: 2020-02-19 10:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.