Skip to content

Commit

Permalink
release: 4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Jan 2, 2025
1 parent 4553b53 commit 24a9f14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion slang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ LocaleSettings.overrideTranslations(
content: r'''
onboarding
title: 'Welcome {name}'
'''
''',
);
// access
Expand All @@ -1170,6 +1170,21 @@ A few remarks:
3. New translations will be parsed but have no effect.
4. New parameters stay unparsed. (i.e. `{name}` stays `{name}`)

If you use dependency injection, then you can create a new overridden instance using `AppLocaleUtils`:

```dart
Translations t2 = AppLocaleUtils.buildWithOverridesSync(
locale: AppLocale.en,
fileType: FileType.yaml,
content: r'''
onboarding
title: 'Welcome {name}'
''',
);
String a = t2.onboarding.title(name: 'Tom'); // "Welcome Tom"
```

### ➤ Dependency Injection

You don't like the included `LocaleSettings` solution?
Expand Down
3 changes: 2 additions & 1 deletion slang/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: slang
description: Localization / Internationalization (i18n) solution. Use JSON, YAML, CSV, or ARB files to create typesafe translations via source generation.
version: 4.4.0
version: 4.4.1
repository: https://github.com/slang-i18n/slang
topics:
- i18n
- l10n
- localization
- internationalization
- translation
Expand Down

0 comments on commit 24a9f14

Please sign in to comment.