mirego / accent

The first developer-oriented translation tool. True asynchronous flow between translators and your team.
https://www.accent.reviews
BSD 3-Clause "New" or "Revised" License
1.26k stars 96 forks source link

Apple *.stringsdict files support #363

Open peetbool opened 1 year ago

peetbool commented 1 year ago

To fully benefit from Accent in Swift project it is crucial to have also support for plural strings which is done using *.stringsdict file. Is this support planned in the nearest future?

simonprev commented 1 year ago

The stringsdict is not just a reference to the localized strings? Then translated with xliff files? Like in this blog post: https://medium.com/@vitaliikuznetsov/plurals-localization-using-stringsdict-in-ios-a910aab8c28c

molind commented 9 months ago

There is an example of stringsdict. It's a xml with some magic inside.

<?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>%d place(s)</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@places@</string>
            <key>places</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%d place</string>
                <key>other</key>
                <string>%d places</string>
            </dict>
        </dict>
        <key>%d day(s)</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@days@</string>
            <key>days</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%d day</string>
                <key>other</key>
                <string>%d days</string>
            </dict>
        </dict>
        <key>%d week(s)</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@weeks@</string>
            <key>weeks</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%d week</string>
                <key>other</key>
                <string>%d weeks</string>
            </dict>
        </dict>
        <key>%d month(s)</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@months@</string>
            <key>months</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%d month</string>
                <key>other</key>
                <string>%d months</string>
            </dict>
        </dict>
        <key>%d year(s)</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@years@</string>
            <key>years</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%d year</string>
                <key>other</key>
                <string>%d years</string>
            </dict>
        </dict>
        <key>%d item(s)</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@items@</string>
            <key>items</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%d item</string>
                <key>other</key>
                <string>%d items</string>
            </dict>
        </dict>
    </dict>
</plist>