Closed ZakariasBW closed 1 month ago
Describe the bug LocaleSettings.overrideTranslationsFromMap fails when provided with a nested map structure that does not include keys at the top level.
To Reproduce
strings.i18n.json
{ "customerService": { "title": "Customer support", "other": { "title": "Other" } } }
type 'ObjectNode' is not a subtype of type 'StringTextNode' in type cast
test('Broken', () { LocaleSettings.overrideTranslationsFromMap( locale: AppLocale.en, isFlatMap: false, map: { "customerService": { "other": { "title": "Test", } } }, ); });
test('Working', () { LocaleSettings.overrideTranslationsFromMap( locale: AppLocale.en, isFlatMap: false, map: { "customerService": { "title": "Customer support", "other": { "title": "Test", } } }, ); });
Expected behavior The field t.customerService.other.title should have value Test in both cases.
t.customerService.other.title
Test
Additional context Slang version for testing is ^3.31.1 with no special slang.yaml config except of course translation_overrides: true.
^3.31.1
slang.yaml
translation_overrides: true
I believe that customerService is wrongly inferred as plural. Can you try to set:
customerService
pluralization: auto: off
Thank you so much for the quick reply🙏, it worked! We didn't think of that😅
Describe the bug LocaleSettings.overrideTranslationsFromMap fails when provided with a nested map structure that does not include keys at the top level.
To Reproduce
strings.i18n.json
type 'ObjectNode' is not a subtype of type 'StringTextNode' in type cast
Expected behavior The field
t.customerService.other.title
should have valueTest
in both cases.Additional context Slang version for testing is
^3.31.1
with no specialslang.yaml
config except of coursetranslation_overrides: true
.