mobile-sdk-ios icon indicating copy to clipboard operation
mobile-sdk-ios copied to clipboard

Setting an unsupported locale code doesn't fall back to a language code

Open chrispomeroyhale opened this issue 2 years ago • 1 comments

Describe the bug Currently, our server tells the clients which locale code to use. (We recognize this is backwards.) This means we call CrowdinSDK.currentLocalization to override the target language. The concern is that the Crowdin supported language codes doesn't list "Italian Italy" (it-IT) just Italy (it). Same story with fr-FR. Meanwhile, Apple's Locale.current.identifer will return it_IT and fr_FR. So there's some mismatching between locale codes between the Apple, our server, and Crowdin.

Over-the-air also doesn't appear to support falling back from it-IT to just it. Instead it fails to retrieve any language over-the-air at all. I spoke with our Android representative who said their SDK integration doesn't have this issue.

Furthermore, additionally, I can't add "it-IT" as a custom language (see screenshot).

To Reproduce After the SDK initializes, set the CrowdinSDK.currentLocalization to a locale code that isn't officially supported by Crowdin. e.g. "it-IT". Ensure there is a localization for the language code e.g. just "it".

Actual behavior No calls to retrieve over-the-air translations are made.

Expected behavior I see two possible outcomes:

  1. Crowdin could provide "it-IT" as opposed to just "Italian" on the website?
  2. Crowdin SDK could handle either "it-IT" or "it"?

Screenshots Screen Shot 2022-03-18 at 4 13 36 PM

Smartphone (please complete the following information): Doesn't seem to matter? I am using an iPhone SE sim 15.2

Additional context

chrispomeroyhale avatar Mar 18 '22 23:03 chrispomeroyhale

@chrispomeroyhale Greetings. We'll review your comment and update you on the matter after that.

DimaYashchyshyn-zz avatar Mar 18 '22 23:03 DimaYashchyshyn-zz