Skip to content

Commit

Permalink
feature: l10 in String interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Sep 1, 2017
1 parent cb711d1 commit 3a590dc
Show file tree
Hide file tree
Showing 6 changed files with 286 additions and 70 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
"""
```

Expand Down
Loading

0 comments on commit 3a590dc

Please sign in to comment.