feat: in-app display language switcher (Settings → Appearance) (#604)

Add a Language selector to Settings → Appearance that overrides the app
display language independent of the device locale. Persists a BCP-47 code
in ServerStoreState.appLanguage; MainActivity.attachBaseContext applies it
via a ContextWrapper (works on minSdk 26, no AppCompat dependency needed
since the Activity is a plain ComponentActivity). Selecting a language
recreates the activity so resources re-resolve immediately.

Includes System default / English / 한국어 options, plus a unit test for
the locale-code resolver.

Note: the new string keys (settings_item_language, language_system,
language_english, language_korean) should be backfilled into values-ko
once PR #602 lands.

Co-authored-by: hy4ri <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andhy4ri authored and GitHub committed 2026-07-15 23:57:39 +03:00
1 parent 4314bddaae
commit b3765bd106
9 files changed
+200

No files matched your search

@@ -498,6 +498,15 @@ object AuthManager {
serverStore.update { it.copy(typingEffectEnabled = enabled) }
}
// ── App display language ───────────────────────────────────────────
// "system" follows the device locale; any other value is a BCP-47 code.
fun getAppLanguage(): String = serverStore.getLatestState().appLanguage
fun setAppLanguage(code: String) {
serverStore.update { it.copy(appLanguage = code) }
}
fun getTypingEffectDelayMs(): Int = serverStore.getLatestState().typingEffectDelayMs
fun setTypingEffectDelayMs(delayMs: Int) {