xcstrings
xcstrings copied to clipboard
Pluralized values causing error
Having pluralized values in your *.xcstrings file causes the script to raise errors.
Changing the values to zero makes the script work without issues.
Error cause in xcstrings:
[...],
"weather_forecast_weather_alerts_%lld_expand_button" : {
"localizations" : {
"en" : {
"variations" : {
"plural" : {
"one" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "weather_forecast_weather_alerts_%lld_expand_button"
}
},
"other" : {
"stringUnit" : {
"state" : "new",
"value" : "weather_forecast_weather_alerts_%lld_expand_button"
}
}
}
}
}
}
},
[...]
Script Error output:
File "/Users/XYZ/xcstrings-main/xcstrings_Gemini.py", line 249, in main
source_string = localizations["en"]["stringUnit"]["value"]
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'stringUnit'