From 515ef9116e711beaea773687e30ae280b133e295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=ADhuajijam?= Date: Thu, 25 Jan 2024 22:38:11 +0800 Subject: [PATCH] feat: make title in NavBar translatable,update zh_rCN translation --- .../java/dev/bluehouse/enablevolte/HomeActivity.kt | 13 +++++++------ app/src/main/res/values-zh-rCN/strings.xml | 14 ++++++++------ app/src/main/res/values/strings.xml | 4 +++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/dev/bluehouse/enablevolte/HomeActivity.kt b/app/src/main/java/dev/bluehouse/enablevolte/HomeActivity.kt index 68e890f..53aa718 100644 --- a/app/src/main/java/dev/bluehouse/enablevolte/HomeActivity.kt +++ b/app/src/main/java/dev/bluehouse/enablevolte/HomeActivity.kt @@ -80,14 +80,15 @@ class HomeActivity : ComponentActivity() { @OptIn(ExperimentalMaterial3Api::class) @Composable fun PixelIMSApp() { + val context = LocalContext.current val navController = rememberNavController() - val carrierModer = CarrierModer(LocalContext.current) + val carrierModer = CarrierModer(context) val currentBackStackEntry by navController.currentBackStackEntryAsState() var subscriptions by rememberSaveable { mutableStateOf(listOf()) } var navBuilder by remember { mutableStateOf Unit>({ - composable("home", "Home") { + composable("home", context.resources.getString(R.string.home)) { Home(navController) } }) @@ -95,18 +96,18 @@ fun PixelIMSApp() { fun generateNavBuilder(): (NavGraphBuilder.() -> Unit) { return { - composable("home", "Home") { + composable("home", context.resources.getString(R.string.home)) { Home(navController) } for (subscription in subscriptions) { navigation(startDestination = "config${subscription.subscriptionId}", route = "config${subscription.subscriptionId}root") { - composable("config${subscription.subscriptionId}", "SIM Config") { + composable("config${subscription.subscriptionId}", context.resources.getString(R.string.sim_config)) { Config(navController, subscription.subscriptionId) } - composable("config${subscription.subscriptionId}/dump", "Config Dump Viewer") { + composable("config${subscription.subscriptionId}/dump", context.resources.getString(R.string.config_dump_viewer)) { DumpedConfig(subscription.subscriptionId) } - composable("config${subscription.subscriptionId}/edit", "Expert Mode") { + composable("config${subscription.subscriptionId}/edit", context.resources.getString(R.string.expert_mode)) { Editor(subscription.subscriptionId) } } diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8cdeddd..8df022e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -26,17 +26,17 @@ 启用视频通话(VT) UT接口下启用补充业务 CDMA下启用补充业务 - 检测到SIM - 支持VoLTE - IMS状态 - 卡 %1$s 的IMS状态 + 检测到 SIM + 支持 VoLTE + IMS 状态 + 卡 %1$s 的 IMS 状态 已注册 未注册 有新版本 %1$s 可用! 启用/禁用功能 显示设置 - 使用4G替换LTE图标 + 使用 4G 替换 LTE 图标 显示 VoWiFI 图标 始终显示数据速率图标 隐藏增强4G(LTE+)图标 @@ -63,8 +63,10 @@ 重新注册IMS 请稍后… 专家模式 - 加载中... + 加载中… 已加载 %1$s 共 %2$s 更改值 搜索 + SIM 配置 + 配置转储查看器 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bcedb1d..7b9938d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -62,8 +62,10 @@ Restart IMS registration Working on it… Expert Mode - Loading... + Loading… Loaded %1$s of %2$s Edit Value Search + SIM Config + Config Dump Viewer