Skip to content

iOS Plurals Not Working with Crowdin SDK #347

@initishbhatt

Description

@initishbhatt

Describe the bug
iOS plural forms are not working correctly when using the Crowdin SDK, despite working perfectly with local bundles fetched via Crowdin CLI. The same .stringsdict files and localization keys work locally but fail when the Crowdin SDK is enabled.

Environment

  • Crowdin Plan: Enterprise
  • Platform: iOS
  • Languages: 14+ languages (en, fr, de, es, pt, ar, ja, ko, etc.)
 Sample .stringsdict Content

  English (en.lproj/Localizable.stringsdict):

  <key>user.achievements</key>
  <dict>
      <key>NSStringLocalizedFormatKey</key>
      <string>%#@value@</string>
      <key>value</key>
      <dict>
          <key>one</key>
          <string>{noOfAchievements} achievement</string>
          <key>other</key>
          <string>{noOfAchievements} achievements</string>
          <key>NSStringFormatValueTypeKey</key>
          <string>d</string>
          <key>NSStringFormatSpecTypeKey</key>
          <string>NSStringPluralRuleType</string>
      </dict>
  </dict>

To Reproduce
Steps to reproduce the behavior:

  1. Setup with Local Bundles (Working):

    • Download translations using Crowdin CLI

    • Use local .strings and .stringsdict files

    • Call localizedString("user.achievements", count: 5)

Result: Returns "{noOfAchievements} achievements" (correct plural)

  1. Setup with Crowdin SDK (Broken):

    • Enable Crowdin SDK in app

    • Configure SDK to pull from distribution

    • Ensure distribution contains the same .stringsdict files

    • Call localizedString("user.achievements", count: 5)

Result: Returns "{noOfAchievements} achievement" (incorrect singular)

Test Across Multiple Languages:

Test with languages having complex plural rules (ar, ru, pl)
All exhibit the same issue - only singular form is used

Expected behavior
When calling localizedString("user.achievements", count: 5), should return "{noOfAchievements} achievements" (plural form) just as it does with local bundles.

func localizedString(_ key: String, count: Int) -> String {
      let format = NSLocalizedString(key, comment: "")
      return String.localizedStringWithFormat(format, count)
  }

Smartphone (please complete the following information):

  • Device: iphone 15, 16
  • OS: iOS 18+

Is there additional configuration required for .stringsdict support via SDK?
If i fetch only stringsdict, plurals are working

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghacktoberfestThis issue welcomes contributions for Hacktoberfesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions