From f3f899e3f1eb99c2034c7999c44fee7344f9ab3e Mon Sep 17 00:00:00 2001 From: Aleksey Blekot Date: Thu, 7 Sep 2023 11:22:56 +0300 Subject: [PATCH 1/5] add info to README.md icerockdev#568 --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index dc335052c..399680a55 100755 --- a/README.md +++ b/README.md @@ -511,6 +511,20 @@ and return to system behaviour (when localization depends on device settings): StringDesc.localeType = StringDesc.LocaleType.System ``` +Android: + +Add this to your app's `build.gradle` to keep all locales in resulting [App Bundle](https://www.youtube.com/watch?v=IPLhLu0kvYw&ab_channel=AndroidDevelopers) if you want them all to be available in runtime (Otherwise, when the user downloads the app from PlayMarket, resources for his system locale only will be available). + +``` +android { + bundle { + language { + enableSplit = false + } + } +} +``` + ### Example 7 - Shared Images Place images in the `commonMain/resources/MR/images` directory. Nested directories are also supported. From 6b320c12e07e57c866d787841e8a5b41c583808d Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Tue, 10 Oct 2023 08:41:13 +0700 Subject: [PATCH 2/5] add notes about issues --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3ed849131..abeb144fb 100755 --- a/README.md +++ b/README.md @@ -805,6 +805,16 @@ with compose you can just call in `commonMain` val assetContent: String? by MR.assets.test.readTextAsState() ``` +## Known issues + +### iOS shows key instead of localized text + +1. check that generated `Localizable.strings` file is valid - open it by Xcode (located in `shared/shared/build/bin/iosSimulatorArm64/debugFramework/shared.framework/:shared.bundle/Contents/Resources/Base.lproj/Localizable.strings` and in other `.lproj` directories. If Xcode show error in file - you should fix content of strings.xml (for example you use some special character that broke file). + +2. check that your generated `.bundle` exist inside application at runtime. In Xcode inside group `Products` select your application and click `Show in Finder`. Then click `Show Package Contents`. Inside `.app` you should see `.bundle` in root directory if you use static framework. And in `Frameworks/shared.framework` if you use dynamic framework. If `bundle` missed - check installation guide. Specifically xcode build phase part if you use static framework. And check that you apply moko-resources plugin in `shared` gradle module. + +3. check that your `strings.xml` contains all keys for language that you use. If you have keys `test1`, `test2` in `Base/strings.xml`, and only `test1` in `ru/strings.xml` then you got key instead of text in ru locale for `test2` key. iOS not fallback to base locale now + ## Samples In `samples` directory you can find multiple projects showed different usages. From bfa42a0e0b07fe50eba11ddb0160e9ec61814bcc Mon Sep 17 00:00:00 2001 From: Tsung Wu Date: Tue, 27 Feb 2024 16:47:32 +0800 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index abeb144fb..2c9a21bf7 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ macOS, iOS, Android the JVM and JS/Browser with the support of the default syste Also MOKO resources supports [Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform) so you can -implement all you UI in Kotlin with Jetpack Compose and MOKO resources. +implement all your UI in Kotlin with Jetpack Compose and MOKO resources. ## Table of Contents From 431ba7b46101c819de2ff04eedb031855799c450 Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Sat, 27 Apr 2024 00:23:10 +0200 Subject: [PATCH 4/5] remove AppCompat dependency --- resources/build.gradle.kts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/build.gradle.kts b/resources/build.gradle.kts index 71ee1d131..3227dbaee 100644 --- a/resources/build.gradle.kts +++ b/resources/build.gradle.kts @@ -39,9 +39,7 @@ dependencies { jvmMainImplementation(libs.icu4j) jvmMainImplementation(libs.batikRasterizer) jvmMainImplementation(libs.batikTranscoder) - - androidMainImplementation(libs.appCompat) - + iosTestImplementation(libs.mokoTestCore) } From 18421c51330e64f3b93beff8e7df6aceae947b31 Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Sat, 27 Apr 2024 00:31:12 +0200 Subject: [PATCH 5/5] appcompat-resources --- gradle/libs.versions.toml | 2 +- resources/build.gradle.kts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2295eb5a8..367fce574 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -52,7 +52,7 @@ mokoGraphics = { module = "dev.icerock.moko:graphics", version.ref = "mokoGraphi mokoTestCore = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersion" } # android -appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" } +appCompatResources = { module = "androidx.appcompat:appcompat-resources", version.ref = "androidAppCompatVersion" } constraintLayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintLayoutVersion" } # android compose diff --git a/resources/build.gradle.kts b/resources/build.gradle.kts index 3227dbaee..bd9ad1aef 100644 --- a/resources/build.gradle.kts +++ b/resources/build.gradle.kts @@ -39,7 +39,9 @@ dependencies { jvmMainImplementation(libs.icu4j) jvmMainImplementation(libs.batikRasterizer) jvmMainImplementation(libs.batikTranscoder) - + + androidMainImplementation(libs.appCompatResources) + iosTestImplementation(libs.mokoTestCore) }