Language setting and translations: Spanish, Japanese, Korean, Chinese; Steam follows it (#187) (#284)

* l10n: move hard-coded UI text into string resources (#212)

About 650 user-facing strings were written in Kotlin and Java, so no
translation could reach them and the UI stayed half English in every
language. They now live in values/strings.xml.

- Dialogs, menus, status lines, toasts and errors shown to the user go
  through getString/stringResource.
- Code that matched on English text now uses IDs: installer and loading
  stages, Decky stages, storage labels and the Back button's order labels.
- Choice lists (upscalers, FPS limits, textures, themes, presets) carry
  @StringRes labels instead of English.
- Robolectric tests read the app's resources (includeAndroidResources).
- Six strings nothing used any more are dropped.

Existing translations are untouched; the new strings show in English
until they are translated.

* Layouts: fit longer text in other languages, and small phones

Found by screenshotting every page, tab and menu in each language on a
phone, a tablet, a 640dp phone and a foldable.

- Rail labels shrink to fit instead of being cut off (FitText).
- Tab rows tighten when they overflow and scroll the chosen tab into view.
- Menus fade over a down arrow when more entries are below, and open
  scrolled to the current choice.
- On a small phone the desktop card's button moves under its title,
  emulator tiles go two across, the GPU support verdict wraps and the
  Updates page stacks the channels under the status.

* l10n: translate every string into Spanish, Japanese, Korean and Chinese (#187)

Simplified Chinese, Traditional Chinese (Taiwan) and Traditional Chinese
(Hong Kong, reviewed for Hong Kong wording) are complete, as are Spanish,
Japanese and Korean: no missing keys and no placeholder mismatches.

* Language setting: follow the system, or a language picked in Setup; Steam uses it too (#187)

- Setup -> Launcher starts with a Language row: "System default (...)"
  and each language by its own name. With nothing picked the app follows
  the system language; a pick applies at once and stays until System
  default is picked again.
- Steam keeps its language in ~/.steam/registry.vdf under both
  Valve/Steam/language and Valve/Steamsteamglobal/language. Before each
  start of the client the guest helper droiddeck-steam-language writes
  both (and exportedsettings.json), and the client gets -language.
  SteamLanguage maps the app's language to Steam's names: english,
  spanish/latam, japanese, koreana, schinese, tchinese.

* l10n: translate the strings main added since, and Chinese review fixes

- Translate the 32 strings added on main since (Windows components,
  device details, Force SSBS, native Steam sleep) into all six languages.
- zh-CN: busy labels say what is in progress again (正在取消, 正在导出
  ...), as the other languages do.
- zh-CN: "set up" is 配置, as Setup is; 设置 stays for Settings.
- zh-TW: proton_compatible_note says 前綴 rather than "prefix".
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-10-06 22:00:21 -04:00
1 parent 0b04678bdc
commit fa99e2aab6
33 files changed
+8292 -781

No files matched your search

@@ -0,0 +1,55 @@
package com.droiddeck.launcher.session
import java.util.Locale
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
class SteamLanguageTest {
private fun steam(tag: String, region: String? = null) = SteamLanguage.forLocale(Locale.forLanguageTag(tag), region)
@Test fun theAppsLanguagesMapToSteams() {
assertEquals("english", steam("en"))
assertEquals("spanish", steam("es"))
assertEquals("japanese", steam("ja"))
assertEquals("koreana", steam("ko"))
assertEquals("schinese", steam("zh-CN"))
assertEquals("tchinese", steam("zh-TW"))
assertEquals("tchinese", steam("zh-HK"))
}
@Test fun chineseFollowsTheScriptBeforeTheRegion() {
assertEquals("tchinese", steam("zh-Hant-CN"))
assertEquals("schinese", steam("zh-Hans-HK"))
assertEquals("schinese", steam("zh"))
assertEquals("schinese", steam("zh-SG"))
assertEquals("tchinese", steam("zh-MO"))
}
@Test fun spanishInTheAmericasIsLatinAmerican() {
assertEquals("latam", steam("es-MX"))
assertEquals("latam", steam("es-419"))
assertEquals("spanish", steam("es-ES"))
// The app's Spanish has no region; the system's says where the player is.
assertEquals("latam", steam("es", region = "AR"))
assertEquals("spanish", steam("es", region = "ES"))
}
@Test fun systemLanguagesTheAppDoesNotShipStillReachSteam() {
assertEquals("german", steam("de-DE"))
assertEquals("brazilian", steam("pt-BR"))
assertEquals("portuguese", steam("pt-PT"))
assertEquals("norwegian", steam("nb-NO"))
assertEquals("indonesian", steam("in-ID"))
assertEquals("ukrainian", steam("uk-UA"))
}
@Test fun anythingElseIsEnglish() {
assertEquals("english", steam("sw-KE"))
assertEquals("english", steam("und"))
}
@Test fun everyAnswerIsALanguageSteamHas() {
Locale.getAvailableLocales().forEach { assertTrue(it.toLanguageTag(), SteamLanguage.forLocale(it) in SteamLanguage.all) }
}
}