diff --git a/slang/CHANGELOG.md b/slang/CHANGELOG.md index 9686a18..4b9dd62 100644 --- a/slang/CHANGELOG.md +++ b/slang/CHANGELOG.md @@ -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 diff --git a/slang/lib/src/builder/builder/translation_model_builder.dart b/slang/lib/src/builder/builder/translation_model_builder.dart index 83ce095..cb06c0f 100644 --- a/slang/lib/src/builder/builder/translation_model_builder.dart +++ b/slang/lib/src/builder/builder/translation_model_builder.dart @@ -304,7 +304,8 @@ Map _parseMapNode({ // leaf // key: 'value' - if (config.fallbackStrategy == FallbackStrategy.baseLocaleEmptyString && + if (baseData != null && + config.fallbackStrategy == FallbackStrategy.baseLocaleEmptyString && value is String && value.isEmpty) { return;