core-locale: shared per-app language plumbing (AppLanguage)
Android-library module, drawn from the byte-identical AppLanguage in Agendula and Calendula: read the shipped languages from res/xml/locales_config.xml, get/set the applied language via AppCompatDelegate, and render each language's autonym. The locales_config resource id is now a parameter, so the module is app-agnostic. appcompat only, no Compose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
46
core-locale/build.gradle.kts
Normal file
46
core-locale/build.gradle.kts
Normal file
@@ -0,0 +1,46 @@
|
||||
// core-locale — per-app language plumbing shared across the family: read the
|
||||
// shipped languages from res/xml/locales_config.xml, get/set the applied
|
||||
// language via AppCompatDelegate, and render each language's autonym. App-
|
||||
// agnostic — the consuming app passes its own locales_config resource id; no
|
||||
// Compose, no DataStore.
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "de.jeanlucmakiola.floret.locale"
|
||||
compileSdk = 37
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 29
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests {
|
||||
all { it.useJUnitPlatform() }
|
||||
isReturnDefaultValues = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// appcompat brings AppCompatDelegate plus its core (LocaleListCompat) and
|
||||
// annotation (XmlRes) transitives.
|
||||
implementation(libs.androidx.appcompat)
|
||||
|
||||
testImplementation(libs.junit.jupiter.api)
|
||||
testRuntimeOnly(libs.junit.jupiter.engine)
|
||||
testRuntimeOnly(libs.junit.platform.launcher)
|
||||
testImplementation(libs.truth)
|
||||
}
|
||||
Reference in New Issue
Block a user