Skip to content

Commit

Permalink
fix: empty strings in base translations should not be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Dec 1, 2024
1 parent e5f934b commit bd9692d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions slang/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 4.4.0

- feat: add `(fallback)` modifier to fallback entries within a map (#268)
- fix: empty strings in base translations should not be removed when using `fallback_strategy: base_locale_empty_string`

## 4.3.0

Expand Down
3 changes: 2 additions & 1 deletion slang/lib/src/builder/builder/translation_model_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ Map<String, Node> _parseMapNode({
// leaf
// key: 'value'

if (config.fallbackStrategy == FallbackStrategy.baseLocaleEmptyString &&
if (baseData != null &&
config.fallbackStrategy == FallbackStrategy.baseLocaleEmptyString &&
value is String &&
value.isEmpty) {
return;
Expand Down

0 comments on commit bd9692d

Please sign in to comment.