Skip to content

Commit 0d4b64f

Browse files
committed
feat(settings): broaden insight-language picker to match auto support
Expand the AI insight language dropdown from 8 to 20 curated languages (adding zh, hi, ar, ru, ja, ko, tr, pl, uk, sv, vi, id) with native-name labels, so a reader who wants insights pinned to a non-Western language can choose it explicitly rather than relying on auto. Every code offered is one the server's auto-resolver also understands, keeping explicit and auto in sync; the list stays a curated subset (not the full ISO 639-1 set) so the non-searchable dropdown remains usable. Also fix the now-stale helper text: auto follows the book's own language, not "the model's default" (see the auto-language change in this branch).
1 parent bc034df commit 0d4b64f

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

app/src/main/java/io/theficos/ereader/ui/settings/SettingsScreen.kt

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,37 @@ import java.time.format.DateTimeParseException
4949

5050
/**
5151
* Curated languages shown in the AI insight language dropdown. The server
52-
* accepts any ISO 639-1 code; this list is the UI surface. Labels are the
53-
* native names of each language so users in the target locale recognize
54-
* them even before the app itself is localized.
52+
* accepts ANY ISO 639-1 code, and `auto` now writes each insight in the
53+
* book's own language (server `_resolve_response_language`), so this list only
54+
* needs to cover users who want to PIN a preferred language that differs from
55+
* the book. It is intentionally a curated subset of the most widely-spoken
56+
* languages rather than the full ISO 639-1 set — a plain, non-searchable
57+
* dropdown stops being usable much past ~20 entries. Every code here is also
58+
* one the server's auto-resolver understands, so explicit and auto stay
59+
* consistent. Labels are the native names so users in the target locale
60+
* recognize them even before the app itself is localized.
5561
*/
5662
private val LANGUAGE_OPTIONS: List<Pair<String, String>> = listOf(
5763
"auto" to "Auto",
5864
"en" to "English",
59-
"it" to "Italiano",
65+
"zh" to "中文",
66+
"hi" to "हिन्दी",
6067
"es" to "Español",
68+
"ar" to "العربية",
6169
"fr" to "Français",
62-
"de" to "Deutsch",
6370
"pt" to "Português",
71+
"ru" to "Русский",
72+
"ja" to "日本語",
73+
"de" to "Deutsch",
74+
"ko" to "한국어",
75+
"it" to "Italiano",
76+
"tr" to "Türkçe",
77+
"pl" to "Polski",
6478
"nl" to "Nederlands",
79+
"uk" to "Українська",
80+
"sv" to "Svenska",
81+
"vi" to "Tiếng Việt",
82+
"id" to "Bahasa Indonesia",
6583
)
6684

6785
@Composable
@@ -435,7 +453,7 @@ fun SettingsScreen(
435453
Text("Insight language", style = MaterialTheme.typography.titleMedium)
436454
Text(
437455
"Language the model writes insights in. " +
438-
"Auto follows the model's default.",
456+
"Auto follows the book's own language.",
439457
style = MaterialTheme.typography.bodyMedium,
440458
color = MaterialTheme.colorScheme.onSurfaceVariant,
441459
)

0 commit comments

Comments
 (0)