mac-cain13 / R.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
MIT License
9.5k stars 765 forks source link

Can't unify 'format' in 'main_widget_number_of_people_title' 'Localizable.stringsdict' (en) #917

Closed isaac-weisberg closed 2 hours ago

isaac-weisberg commented 3 hours ago

I have a stringsdict:

<?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>main_widget_number_of_people_title</key>
    <dict>
        <key>NSStringLocalizedFormatKey</key>
        <string>%#@format@</string>
        <key>format</key>
        <dict>
            <key>NSStringFormatSpecTypeKey</key>
            <string>NSStringPluralRuleType</string>
            <key>NSStringFormatValueTypeKey</key>
            <string>li</string>
            <key>one</key>
            <string>1 person</string>
            <key>other</key>
            <string>%@ people</string>
        </dict>
    </dict>
</dict>
</plist>

When R.swift runs, I the strings from this stringdict are not generated, and R.swift silently fails with message:

Can't unify 'format' in 'main_widget_number_of_people_title' 'Localizable.stringsdict' (en)

Other strings work fine, and other stringdicts in my project work fine too. it's just that this specific stringdict is somehow broken. Can you help find the issue please?

isaac-weisberg commented 2 hours ago

Found the issue - because I defined type key li, in the templates I should've used %li instead of %@. Thank you.