Reputation: 1329
I'm trying to use the package intl but my brain fails to understand ...
Do you have a simple example of how to use it, when we come from chrome.i18n?
Upvotes: 2
Views: 832
Reputation: 2971
Here's a sample - https://github.com/dart-lang/sample-polymer-intl
Top-level explanation: You write your message initially wrapped in an Intl.message call, which should be in a function that does just that. So, e.g.
hello() => Intl.message("Hello world");
print(hello());
If you run that it will just run without any modification. You can extract out the messages using bin/extract_to_arb.dart, translate them, and run bin/generate_from_arb.dart.
Compared to chrome.i18n:
Is that what you were looking for?
Upvotes: 1
Reputation: 47
If you just want to localize some messages, I think that l10n would be nice to you. It generates PO files and use it to translate.
Upvotes: 1