Closed awatke closed 8 months ago
Hello! Thanks for reporting.
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
We've probably not exporting this sequence correctly. It's a bug.
The plural variable name stored in Tolgee wasn't intended to be exorted to .stringsdict
file, since it doesn't seem to have any meaning in the .stringsdict
context. Am I mistaken?
Thanks for the quick response.
What exactly is the variable for?
And there are 2 missing keys not only NSStringFormatSpecTypeKey
:
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
From apple docs:
Furthermore, using the NSStringFormatValueTypeKey format specifier in the localized formatted strings is optional. For example, the format string for the one category in English can be One home found, while the other category can be %d homes found.
So I guess, we can omit it. However, I will test the export output with real XCode project.
What exactly is the variable for?
When you export to ICU or other formats supporting named properties, this is the name of the plural variable. e.g.
Variable name: count
will be exported in ICU plural as: {count, plural, one {I have one dog} other {I have # dogs}}
OK, so according to my testing, the NSStringFormatValueTypeKey
isn't optional. We will have to add it too.
Hello,
I think there is an issue with the export of apple .stringsdict.
If I have a placeholder for numbers like %d, but after the export I can't use it. There 2 missing keys in the exported dict (
NSStringFormatSpecTypeKey
andNSStringFormatValueTypeKey
).This is the exported result:
and this is the expected result:
see: https://developer.apple.com/documentation/xcode/localizing-strings-that-contain-plurals
Can anybody check this?
And if I change the plurals variable name in tolgee, I don't see this changes in the exported dict. Is that also a bug?