Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple *.stringsdict files support #363

Open
peetbool opened this issue Jul 11, 2023 · 2 comments
Open

Apple *.stringsdict files support #363

peetbool opened this issue Jul 11, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@peetbool
Copy link

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 simonprev added the enhancement New feature or request label Aug 25, 2023
@simonprev
Copy link
Member

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
Copy link

molind commented Dec 13, 2023

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants