Permalink
Browse files

feature: l10 in String interpolation

  • Loading branch information...
MikeMitterer committed Sep 1, 2017
1 parent cb711d1 commit 3a590dc745f1f4e65f3eae384f811c22e049f479
Showing with 286 additions and 70 deletions.
  1. +13 −5 README.md
  2. +225 −49 lib/parser/Lexer.dart
  3. +6 −6 lib/parser/Parser.dart
  4. +4 −2 lib/parser/Token.dart
  5. +1 −1 test/unit/_resources/login.dart.txt
  6. +37 −7 test/unit/parser/Parser_test.dart
View
@@ -16,18 +16,26 @@ Since v1.x xgettext creates `locale/templates/LC_MESSAGES/messages.gettext.pot`
## Supported syntax (.dart + .html)
`.dart`-File:
```dart
// Translator: Comment
// Translator: Comment I
_("String to translate");
l10n("String to translate");
// Translator: Comment
// Translator: Comment II
_("String to translate", "Plural form of String");
l10n("String to translate", "Plural form of String");
// Translator: Comment III
print("Hallo ${_('world')}!");
// Translator: Comment IV
print("Hallo ${translate(_('world'))}!");
template = """
<!-- Translator: Comment -->
_("String to translate", "Plural form of String");
l10n("String to translate", "Plural form of String");
<span translate='yes'>
<!-- Translator: Comment V -->
_("String to translate", "Plural form of String");
l10n("String to translate", "Plural form of String");
</span>
"""
```
Oops, something went wrong.

0 comments on commit 3a590dc

Please sign in to comment.