- Notifications
You must be signed in to change notification settings - Fork 944
Open
Description
I think the usage of stringsdicts would bring DateTools to a new level by offering proper support for all languages without the need to hack the strings files with "__" rules.
Simple example of stringsdict for Slovenian:
<?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"> <plist version="1.0"> <dict> <key>dt_seconds_ago</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@seconds@</string> <key>seconds</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>zero</key> <string>pravkar</string> <key>one</key> <string>sekundo nazaj</string> <key>two</key> <string>2 sekundi nazaj</string> <key>few</key> <string>%d sekunde nazaj</string> <key>other</key> <string>%d sekund nazaj</string> </dict> </dict> </dict> </plist> The example usage (with forced SL locale):
let locale = Locale(identifier: "sl") let format = NSLocalizedString("dt_seconds_ago", comment: "") let string = String(format: format, locale: locale, 1) Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels