using String Catalog, missing locale entries don't fall back to source language. for example,
"%lld videos" : {
"comment" : "Label for a number of videos",
"extractionState" : "manual",
"localizations" : {
"en" : {
"variations" : {
"plural" : {
"one" : {
"stringUnit" : {
"state" : "translated",
"value" : "%(count)lld video"
}
},
"other" : {
"stringUnit" : {
"state" : "translated",
"value" : "%(count)lld videos"
}
}
}
}
},
this allows us to use Text(.videos(count: 1)) in English and it'll produce "1 video" as expected but when the locale is French for example, it'll produce "1" instead, until "fr" entry will be added. this is extremely inconvenient. what's the proper workaround?
Just for extra clarification, the build setting BUILD_ONLY_KNOWN_LOCALIZATIONS builds languages included in the list of languages as denoted in your project settings. You can use the - button to remove languages only from the list, and keep their content in the project.
As far as workarounds, you can change how you load the string from using Text(.videos(count: 1)) to Text(LocalizedStringResource("%lld videos", defaultValue: "\(count) videos")), and this should fall back to \(count) videos at runtime.
Alternatively, you can use the English values for French in your String Catalog, and select "Mark for Review", so that you don't forget to change them later.