Closed tomquist closed 8 years ago
Does this work in all permutations if your using it without R.swift?
On 20 May 2016, at 17:53, tomquist notifications@github.com wrote:
The following .stringsdict file fails with a warning
Skipping string documentList.info.remaining in 'Localizable' (Base), not all format specifiers are consecutive
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
documentList.info.remaining NSStringLocalizedFormatKey %1$#@days@ days NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey ld zero %2$#@hours@ remaining one One day remaining other %ld days remaining hours NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey ld zero %3$#@minutes@ one One hour other %ld hours minutes NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey ld zero %4$#@seconds@ one One minute other %ld minutens seconds NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey ld one %ld second other %ld seconds — You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub
To elaborate:
R.swift doesn't allow this because String(format:)
doesn't work with non-consecutive format specifiers in a stringsdict.
Using this example, the following expression:
String(format: NSLocalizedString("documentList.info.remaining", comment: ""), 0, 0, 1, 0)
Results in: 0 seconds remaining
instead of: One minute
.
I think the stringsdict format is not intended to be used in such a way.
The following .stringsdict file fails with a warning