Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use stringResource in NavBar,update zh_rCN translation #241

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions app/src/main/java/dev/bluehouse/enablevolte/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,34 @@ 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<SubscriptionInfo>()) }
var navBuilder by remember {
mutableStateOf<NavGraphBuilder.() -> Unit>({
composable("home", "Home") {
composable("home", context.resources.getString(R.string.home)) {
Home(navController)
}
})
}

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)
}
}
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
<string name="enable_video_calling_vt">启用视频通话(VT)</string>
<string name="enable_ss_over_ut">UT接口下启用补充业务</string>
<string name="enable_ss_over_cdma">CDMA下启用补充业务</string>
<string name="sim_detected">检测到SIM</string>
<string name="volte_supported_by_device">支持VoLTE</string>
<string name="ims_status">IMS状态</string>
<string name="ims_status_for">卡 %1$s 的IMS状态</string>
<string name="sim_detected">检测到 SIM</string>
<string name="volte_supported_by_device">支持 VoLTE</string>
<string name="ims_status">IMS 状态</string>
<string name="ims_status_for">卡 %1$s 的 IMS 状态</string>
<string name="permissions_capabilities"><![CDATA[权限与兼容性]]></string>
<string name="registered">已注册</string>
<string name="unregistered">未注册</string>
<string name="newer_version_available">有新版本 %1$s 可用!</string>
<string name="feature_toggles">启用/禁用功能</string>
<string name="cosmetic_toggles">显示设置</string>
<string name="show_4g_for_lte_data_icon">使用4G替换LTE图标</string>
<string name="show_4g_for_lte_data_icon">使用 4G 替换 LTE 图标</string>
<string name="show_vowifi_icon">显示 VoWiFI 图标</string>
<string name="always_show_data_icon">始终显示数据速率图标</string>
<string name="hide_enhanced_data_icon">隐藏增强4G(LTE+)图标</string>
Expand All @@ -63,8 +63,10 @@
<string name="restart_ims_registration">重新注册IMS</string>
<string name="please_wait">请稍后…</string>
<string name="expert_mode">专家模式</string>
<string name="loading">加载中...</string>
<string name="loading">加载中</string>
<string name="loaded">已加载 %1$s 共 %2$s</string>
<string name="edit_value">更改值</string>
<string name="search">搜索</string>
<string name="sim_config">SIM 配置</string>
<string name="config_dump_viewer">配置转储查看器</string>
</resources>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@
<string name="restart_ims_registration">Restart IMS registration</string>
<string name="please_wait">Working on it…</string>
<string name="expert_mode">Expert Mode</string>
<string name="loading">Loading...</string>
<string name="loading">Loading</string>
<string name="loaded">Loaded %1$s of %2$s</string>
<string name="edit_value">Edit Value</string>
<string name="search">Search</string>
<string name="sim_config">SIM Config</string>
<string name="config_dump_viewer">Config Dump Viewer</string>
</resources>
Loading