Comments (3)
We solve that with our custom handling of fetching resources from the correct bundle. Whenever we tried to fetch from local data we used the moko bundle, and when we tried to use Phrase OTA data, we used the iOS app bundle.
from ios-sdk.
Hi @BVantur, that's great to hear that both SDKs already work almost out of the box with KMP! Would you mind sharing the snippet that you use to use the correct bundle on iOS if that's possible? I would like to make sure that the KMP support is also properly documented
from ios-sdk.
Yeah, sure.
We have a strange behavior in our app and I am not even sure if the above issue is a valid issue that we observed, In the end, what we needed to do with the iOS part of the app, is to use 2 different bundles in our LocalizationManager class.
For moko-based strings that we want to use in a case when there were no Phrase OTA texts present, we used this bundle:
SharedRes.strings().__platformDetails.nsBundle
But for Phrase OTA texts we needed to use a bundle depending on the language with the URL like this:
let phrasePath = "com.phrase.phraseSDK/Translations/\(languageCode).lproj"
let languageDirectoryURL = applicationSupportDirectory.appendingPathComponent(phrasePath, isDirectory: true)
return languageDirectoryURL
Bundle(url: languageDirectoryURL)
In our LocalizationManager we are always trying to read Phrase OTA text first and if it doesn't exist we fall back to a bundle that has strings from the moko library.
I hope this comment will help someone who might end up in the same situation.
from ios-sdk.
Related Issues (20)
- Two languages being returned when using "localeOverride" HOT 12
- Planning for OTA SwiftUI support? HOT 3
- String is not localised when running test plan with multiple configs HOT 4
- Preferred language automatically switch to Localization native development region HOT 5
- Xcode 14 preview error HOT 3
- tableName parameter is ignored, Phrase always returns from Localizable HOT 9
- New strings values are not available on updateTranslation completion handler HOT 11
- Can we get a new "Example App" HOT 3
- Translations from other tables are lost HOT 11
- Latencies after switching from 4.0.1 to 4.1.0 HOT 7
- Configure OTA with two different distributions HOT 3
- Support mac catalyst
- Support mac catalyst HOT 3
- Phrase App Inconsistency update error HOT 7
- Malformed Archive Error and SPM Compatibility Issue HOT 5
- Add Privacy Manifest file to library if needed HOT 5
- Fallback issue when using `Phrase.shared.localizedString` HOT 3
- Application language change issue HOT 7
- Live OTA update (like Android) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-sdk.