phrase / ios-sdk

Phrase Over the Air iOS SDK
https://phrase.com
Other
14 stars 3 forks source link

Phrase seems to be using incorrect locale #16

Closed basine closed 4 years ago

basine commented 4 years ago

We are trying to localise our app for the German and Swiss market and have noticed a behaviour that seems incorrect to us:

When the user has selected Germany as their country, but Swiss German as their preferred language in settings, we would expect the app to update the Swiss German de-CH translation. In reality it is trying to download the German translation de-DE.

This seems incorrect, since the user's preference is Swiss German, not German. I assume that you are using Locale.current instead of Bundle.main.preferredLanguages to figure out the users language preference?

We know we can override the locale that's being used, but were still wondering if this behaviour was intentional or rather a bug.

winkelsdorf commented 4 years ago

Thank you for bringing this to our attention @basine.

We will check the behaviour and give feedback at short notice.

A question for better understanding: Is Swiss German (de-CH) also made available as language in the Xcode Project and assigned as translation in the OTA backend, too?

basine commented 4 years ago

Yes, I added them for testing the behaviour

basine commented 4 years ago

Sorry, this detail isn't really clear though: We have a "de" localization and a "de-CH" both on Phrase and in the app. There is no "de-DE" localization.

winkelsdorf commented 4 years ago

@basine No problem, thanks for the clarification! I'll try to reproduce this asap.

ffittschen commented 4 years ago

We have a similar problem at the moment: When setting only the language instead of language and region, we wonโ€˜t get the expected OTA translations, but Phrase is returning the translation from the fallback.

Example: Phrase project is configured with these languages:

When changing the language on the phone (or simulator) but keeping the region, we often get combinations like

In those cases Phrase returns the fallback (en_US) instead of looking for a match with only the language code.

We would expect that asking the SDK for a translation with the nl_DE locale would return the translations for nl_NL. Is there any way we can achieve this without creating the duplication of languages in Phrase which @basine already mentioned?

winkelsdorf commented 4 years ago

@basine I was able to reproduce the mentioned behaviour with the locale setup given. We are going to release an update later this week. Thank you very much for reporting!

@ffittschen Your issue is likely different from what @basine describes. The fallback is handled in the Backend, so https://github.com/phrase/ios-sdk/issues/17 is probably what you need, too? @theSoenke

ffittschen commented 4 years ago

@winkelsdorf Indeed, sorry. I was reading both issues and replied to the wrong one. I'll move the comment over to #17 .

winkelsdorf commented 4 years ago

@ffittschen No problem, that's what I thought ๐Ÿ‘

winkelsdorf commented 4 years ago

@basine Sorry for the delay. I would like to inform you that this and another problem have been successfully identified and resolved. An update will be released soon.

winkelsdorf commented 4 years ago

@basine Thank you for your patience. The release is now available ๐Ÿš€