mirror of
https://github.com/null2264/yokai.git
synced 2025-07-18 06:46:57 +00:00
feat: Start using moko for i18n
This commit is contained in:
parent
872cc92c93
commit
6d531fbb5c
19 changed files with 171 additions and 44 deletions
49
i18n/build.gradle.kts
Normal file
49
i18n/build.gradle.kts
Normal file
|
@ -0,0 +1,49 @@
|
|||
plugins {
|
||||
kotlin("multiplatform")
|
||||
id("com.android.library")
|
||||
id("dev.icerock.mobile.multiplatform-resources")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
androidTarget()
|
||||
|
||||
applyDefaultHierarchyTemplate()
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
api(libs.moko.resources)
|
||||
}
|
||||
}
|
||||
val androidMain by getting {
|
||||
dependsOn(commonMain)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "yokai.i18n"
|
||||
|
||||
sourceSets {
|
||||
named("main") {
|
||||
res.srcDir("src/commonMain/moko-resources")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
multiplatformResources {
|
||||
resourcesPackage.set("yokai.i18n")
|
||||
}
|
||||
|
||||
tasks {
|
||||
val localesConfigTask = registerLocalesConfigTask(project)
|
||||
preBuild {
|
||||
dependsOn(localesConfigTask)
|
||||
}
|
||||
|
||||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs += listOf(
|
||||
"-Xexpect-actual-classes",
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue