mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-26 20:10:40 +01:00
Migrate to multiplatform string resources (#10147)
* Migrate to multiplatform string resources * Move plurals translations into separate files * Fix lint check on generated files
This commit is contained in:
@@ -1,27 +1,45 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
id("com.android.library")
|
||||
kotlin("android")
|
||||
id("dev.icerock.mobile.multiplatform-resources")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
androidTarget()
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
api(libs.moko.core)
|
||||
}
|
||||
}
|
||||
val androidMain by getting {
|
||||
dependsOn(commonMain) // https://github.com/icerockdev/moko-resources/issues/562
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "tachiyomi.i18n"
|
||||
|
||||
sourceSets {
|
||||
named("main") {
|
||||
res.srcDir("src/commonMain/resources")
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))
|
||||
}
|
||||
}
|
||||
|
||||
multiplatformResources {
|
||||
multiplatformResourcesPackage = "tachiyomi.i18n"
|
||||
}
|
||||
|
||||
tasks {
|
||||
val localesConfigTask = registerLocalesConfigTask(project)
|
||||
|
||||
// Duplicating Hebrew string assets due to some locale code issues on different devices
|
||||
val copyHebrewStrings by registering(Copy::class) {
|
||||
from("./src/main/res/values-he")
|
||||
into("./src/main/res/values-iw")
|
||||
include("**/*")
|
||||
}
|
||||
|
||||
preBuild {
|
||||
dependsOn(copyHebrewStrings, localesConfigTask)
|
||||
dependsOn(localesConfigTask)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user