Description
As per a commit in the Flutter localizations tool from November 2024, it is now preferred (effectively enforced) to match ARB placeholder types between all languages. Means if there's a template ARB file with defines a placeholder, all other ARB files must include and match that placeholder.
However, using the Localizely CLI, a pull command would automatically populate the placeholders in all files, but not their types. E.g.:
template_arb_file
"someTranslation": "With some {placeHolder}",
"@someTranslation": {
"placeholders": {
"placeHolder": {
"type": "String"
}
}
}
Would become this in any other languages ARB file:
"someTranslation": "Another language {placeHolder}",
"@someTranslation": {
"placeholders": {
"placeHolder": {}
}
}
Which leads to the following error when flutter gen-l10n
is executed:
The placeholder, type, has its "type" resource attribute set to the "null" type in locale "<OTHER_LANGUAGE>",
but it is "String" in the template placeholder. For compatibility with template placeholder,
change the "type" attribute to "String".
This also happens if no specific type is defined in the template ARB file, in this case complaining about null
(in other language) not matching Object
from template ARB.
Is there any way around this?