Open Liquidsoul opened 1 month ago
hi,
I'll discuss the topic with the team. I'll give an update in the middle of next week.
Hi, I haven't had the chance to talk to the team yet, so the feedback won't come until next week.
Hi @Liquidsoul ,
I've spoken to the team. We have a fallback to the translations in the main bundle if the key was not found and if no fallback was set. So if the fallback is nil, the SDK will pull the translation from the main bundle.
As an alternative, we suggest extending the swiftgen script to pass the translation from the main bundle as fallback.
Phrase.shared.localizedString(
forKey: "your.new.key",
value: Bundle.main.localizedString(forKey: "your.new.key", value: "fallback", table: "Localizable"),
table: "Localizable"
)
At the moment, we would not make any adjustments to the SDK, as the current implementation gives the user a certain degree of flexibility.
Hi,
I hope this is the right place to report this issue we have with the behavior of
Phrase.localizedString
.Context
updateTranslation
at app launchPhraseSDKMainBundleProxyDisabled
is set to YES in Info.plistPhrase.shared.localizedString()
instead of SwitfGen default's implementation that usesBundle.localizedString
Steps
Phrase.shared.localizedString
on the new keyResult
Phrase.shared.localizedString(forKey: "your.new.key", value: "fallback", table: "Localizable")
returnsfallback
Bundle.main.localizedString(forKey: "your.new.key", value: "fallback", table: "Localizable")
returns the translated key in the device's languageThe behavior of
Phrase.localizedString
does not match the behavior of theBundle.localizedString
and that triggers the fallback that is not in the device's language. We expect that Phrase uses the default implementation of the OS so that it shows the correct strings to the user and not the fallback value when no translation is found.Thank you in advance for your time on this.