Merge pull request #937

* i18n Fix II
This commit is contained in:
Dawn.Liu
2026-04-26 15:13:24 +08:00
committed by GitHub
parent 2c63332403
commit c1d9d57203
9 changed files with 297 additions and 216 deletions
@@ -209,6 +209,7 @@ fun BackupConfigScreen(
SplicedColumnGroup(title = stringResource(R.string.web_dav_set)) {
InputSettingItem(
title = stringResource(R.string.web_dav_url),
description = stringResource(R.string.web_dav_url_s),
value = BackupConfig.webDavUrl,
defaultValue = "",
onConfirm = { BackupConfig.webDavUrl = it }
@@ -216,7 +217,7 @@ fun BackupConfigScreen(
ClickableSettingItem(
title = stringResource(R.string.web_dav_account),
description = "设置 WebDAV 账号和密码",
description = stringResource(R.string.web_dav_account_d),
onClick = {
tempAccount = viewModel.getWebDavAccount()
tempPassword = viewModel.getWebDavPassword()
@@ -239,18 +240,19 @@ fun BackupConfigScreen(
)
ClickableSettingItem(
title = "测试 WebDav 配置",
description = "测试 WebDav 服务工作状态",
title = stringResource(R.string.test_sync_t),
description = stringResource(R.string.test_sync_d),
onClick = {
scope.launch {
showLoadingDialog = true
loadingText = "测试中…"
loadingText = context.getString(R.string.test_sync_loading_text)
val success = viewModel.testWebDav()
showLoadingDialog = false
if (success) {
snackbarHostState.showSnackbar("WebDav 配置正确")
snackbarHostState.showSnackbar(context.getString(R.string.test_sync_status_success))
} else {
snackbarHostState.showSnackbar("WebDav 配置错误")
snackbarHostState.showSnackbar(context.getString(R.string.test_sync_status_fail))
}
}
}
@@ -82,13 +82,13 @@ fun CoverRuleConfigSheet(
}
InputSettingItem(
title = "搜索URL",
title = stringResource(R.string.search_via_url),
value = searchUrl,
onConfirm = { searchUrl = it }
)
InputSettingItem(
title = "封面规则",
title = stringResource(R.string.cover_rule_edit),
value = coverRule,
onConfirm = { coverRule = it }
)
@@ -69,7 +69,7 @@ fun BookshelfConfigSheet(
// Sort Order
CompactDropdownSettingItem(
title = "排序方向",
title = stringResource(R.string.sort_order),
selectedValue = BookshelfConfig.bookshelfSortOrder.toString(),
displayEntries = arrayOf(
stringResource(R.string.ascending_order),
@@ -85,10 +85,10 @@ fun BookshelfConfigSheet(
else BookshelfConfig.bookshelfLayoutModePortrait
CompactDropdownSettingItem(
title = "布局模式",
title = stringResource(R.string.layout_mode),
description = stringResource(if (isLandscape) R.string.screen_landscape else R.string.screen_portrait),
selectedValue = layoutMode.toString(),
displayEntries = arrayOf("列表", "网格"),
displayEntries = arrayOf(stringResource(R.string.layout_mode_list),stringResource(R.string.layout_mode_grid)),
entryValues = arrayOf("0", "1"),
onValueChange = {
if (isLandscape) BookshelfConfig.bookshelfLayoutModeLandscape = it.toInt()
@@ -103,7 +103,7 @@ fun BookshelfConfigSheet(
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
CompactDropdownSettingItem(
title = "网格样式",
title = stringResource(R.string.grid_style),
selectedValue = BookshelfConfig.bookshelfGridLayout.toString(),
displayEntries = stringArrayResource(R.array.bookshelf_grid_layout),
entryValues = Array(stringArrayResource(R.array.bookshelf_grid_layout).size) { it.toString() },
@@ -125,14 +125,14 @@ fun BookshelfConfigSheet(
)
CompactSwitchSettingItem(
title = "标题小字体",
title = stringResource(R.string.compact_title_font),
checked = BookshelfConfig.bookshelfTitleSmallFont,
color = MaterialTheme.colorScheme.surface,
onCheckedChange = { BookshelfConfig.bookshelfTitleSmallFont = it }
)
CompactSwitchSettingItem(
title = "标题居中",
title = stringResource(R.string.center_aligned_title),
checked = BookshelfConfig.bookshelfTitleCenter,
color = MaterialTheme.colorScheme.surface,
onCheckedChange = { BookshelfConfig.bookshelfTitleCenter = it }
@@ -147,14 +147,14 @@ fun BookshelfConfigSheet(
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
CompactSwitchSettingItem(
title = "紧凑模式",
title = stringResource(R.string.compact_mode),
checked = BookshelfConfig.bookshelfLayoutCompact,
color = MaterialTheme.colorScheme.surface,
onCheckedChange = { BookshelfConfig.bookshelfLayoutCompact = it }
)
CompactSwitchSettingItem(
title = "显示分隔线",
title = stringResource(R.string.show_divider_line),
checked = BookshelfConfig.bookshelfShowDivider,
color = MaterialTheme.colorScheme.surface,
onCheckedChange = { BookshelfConfig.bookshelfShowDivider = it }
@@ -177,7 +177,7 @@ fun BookshelfConfigSheet(
}
CompactSliderSettingItem(
title = "标题最大行数",
title = stringResource(R.string.max_title_lines),
value = BookshelfConfig.bookshelfTitleMaxLines.toFloat(),
valueRange = 1f..5f,
steps = 4,
@@ -185,7 +185,7 @@ fun BookshelfConfigSheet(
)
CompactSwitchSettingItem(
title = "封面阴影",
title = stringResource(R.string.cover_shadow),
checked = BookshelfConfig.bookshelfCoverShadow,
color = MaterialTheme.colorScheme.surface,
onCheckedChange = { BookshelfConfig.bookshelfCoverShadow = it }
@@ -251,7 +251,7 @@ fun BookshelfConfigSheet(
// Refresh Limit
CompactSliderSettingItem(
title = stringResource(R.string.bookshelf_update_limit),
description = if (BookshelfConfig.bookshelfRefreshingLimit <= 0) "无限制" else "${BookshelfConfig.bookshelfRefreshingLimit}",
description = if (BookshelfConfig.bookshelfRefreshingLimit <= 0) stringResource(R.string.refresh_limit_unlimited) else stringResource(R.string.refresh_limit_books, BookshelfConfig.bookshelfRefreshingLimit),
value = BookshelfConfig.bookshelfRefreshingLimit.toFloat(),
valueRange = 0f..100f,
steps = 100,
@@ -137,7 +137,7 @@ fun RssScreen(
context.startActivity<RssSourceActivity>()
dismiss()
},
text = "订阅源管理"
text = stringResource(R.string.rss_feed_management),
)
PillDivider()
RoundDropdownMenuItem(