mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-07 19:06:11 +00:00
Extraction sweep: every user-visible hardcoded English string in android/app moved to values/strings.xml with feature-prefixed keys (sessions_/chat_/files_/scratchlist_/pairing_/new_session_/tool_...); values-zh-rCN/strings.xml translates all 448 keys, terminology aligned with web/src/lib/locales/zh-CN.ts. ViewModels stay string-free: transient notices became semantic sealed types resolved at the UI layer (ChatNotice, ScratchlistNotice + ScratchlistImportRejection, PairingError, DictationErrorKind, SessionListError.DeleteFailed.stillActive); ViewModels that genuinely compose display text take small Strings seams with English defaults for JVM tests (FilesStrings, FileViewerStrings, NewSessionStrings); toolCardPresentation gains a Resources parameter. Language switching: LanguagePrefs gains SYSTEM (follow system, the new default); Settings applies AppCompatDelegate.setApplicationLocales immediately; MainActivity now extends AppCompatActivity over Theme.AppCompat.DayNight.NoActionBar with autoStoreLocales + android:localeConfig; FCM/WorkManager surfaces wrap the application context via localizedForAppLanguage (per-app locales miss non-activity contexts below API 33). Verification: :app:assembleDebug green, :app:lintDebug 0 errors (MissingTranslation clean), full JVM test gate green (176 app tests; notice assertions updated to the semantic types).