Closed h-leroy-betclic closed 1 year ago
Hi @h-leroy-betclic, which version of the SDK are you currently using? Could you check with the latest SDK 4.1? https://github.com/phrase/ios-sdk/releases/tag/4.1.0 The issue with multiple tables should be resolved in the version 4.1
@h-leroy-betclic Thank you for your report. We need to investigate your use case a bit more to provide a solution for this, too. Keeping you updated here.
@theSoenke I think this might be a new issue which is quite different from our common use case.
Hi @theSoenke, @winkelsdorf, yes it's on 4.1.0. The difference i notice from this issue https://github.com/phrase/ios-sdk/issues/50 is the problem happens after the first sync has been done (not setup).
@theSoenke, @winkelsdorf do you reproduce the issue ? For information, we have postponed OTA feature delivery (again), so the fix is very expected. Thank's
Hi @h-leroy-betclic, I'm sorry for the inconvenience and causing the delay in rolling out OTA. We're now looking into this and expect to have a solution in the next 1-2 weeks. I'll keep you posted here once there as soon as there is an update.
@theSoenke , @winkelsdorf any news ?
@h-leroy-betclic unfortunately no update yet. We will need a few more days to tackle this
@h-leroy-betclic I was able to identify a problem related to the fallback to the iOS main bundle and there will be an update for it in a couple of days.
We ensured the following will be working:
Phrase.shared.localizedString
or
b) the swizzled methods Bundle.main.localizedString
/ NSLocalizedString
(In both cases with table set to nil
or Localizable
)localizedString(forKey: key, value: value, table: tableName)
on the Main bundle, thus keeping your table
Parameter. Phrase.shared.localizedString
will just return nil
to allow implementing a custom fallback logic.This allows us to support different scenarios:
Support for downloading translations for different tables and/or translating for them unfortunately is something we currently don't support. Please see the last comment in https://github.com/phrase/ios-sdk/issues/25.
cc @theSoenke
Edit: Related to #50
@theSoenke , @winkelsdorf any news ??
@h-leroy-betclic Thank you for your patience. We have just released a new release that addresses the issue (v4.2.0). We are looking forward to your feedback!
Closed, as very likely fixed. Feel free to reopen if there are comments.
Once a sync has been done, the tableName parameter do not work anymore.
NSLocalizedString(<key>, tableName: <tableName>, comment: "")
My project work with multiple tables : A and B, that are 2 distinct projects on Phrase. i use OTA to sync A (since OTA can only sync one project) Once a sync has been done :
NSLocalizedString(<key>, tableName: A, comment: "")
: nokNSLocalizedString(<key>, tableName: B, comment: "")
: nok, all translations from B are lost !!NSLocalizedString(<key>, tableName: nil, comment: "")
: ok, it gives sync translations from project AYou need to store the sync data mapped to a tableName (project name is a good candidate), and check it correctly in your swizzling. Or add tableName parameter in updateTranslation func, default nil, so no pb upgrading the sdk. Thank's