Skip to content

Commit

Permalink
feat: Make strings translatable, Chinese localisation update (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
huajijam authored Dec 13, 2023
1 parent 5e13753 commit 6a07df0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/dev/bluehouse/enablevolte/Components.kt
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,12 @@ fun FiniteLoadingDialog(current: Int, total: Int) {
) {
Box(modifier = Modifier.padding(16.dp)) {
Column {
Text("Loading...", fontWeight = FontWeight.Bold, fontSize = 24.sp)
Text(stringResource(R.string.loading), fontWeight = FontWeight.Bold, fontSize = 24.sp)
LinearProgressIndicator(
modifier = Modifier.semantics(mergeDescendants = true) {}.padding(top = 24.dp, bottom = 4.dp).fillMaxWidth(),
progress = current.toFloat() / total,
)
Text(text = "Loaded $current of $total")
Text(stringResource(R.string.loaded, current, total))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ fun Config(navController: NavController, subId: Int) {
}
}
ClickablePropertyView(
label = "Expert Mode",
label = stringResource(R.string.expert_mode),
value = "",
) {
navController.navigate("config$subId/edit")
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/dev/bluehouse/enablevolte/pages/Editor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fun Editor(subId: Int) {
IconButton({ showFieldNameInsteadOfKey = !showFieldNameInsteadOfKey }) {
if (showFieldNameInsteadOfKey) { Text("a") } else { Text("A") }
}
TextField(searchKeyword, modifier = Modifier.fillMaxWidth().weight(1f), label = { Text("Search") }, onValueChange = { searchKeyword = it }, singleLine = true, trailingIcon = {
TextField(searchKeyword, modifier = Modifier.fillMaxWidth().weight(1f), label = { Text(stringResource(R.string.search)) }, onValueChange = { searchKeyword = it }, singleLine = true, trailingIcon = {
if (searchKeyword.isNotEmpty()) {
IconButton({ searchKeyword = "" }) {
Icon(Icons.Filled.Clear, contentDescription = "Localized description")
Expand Down Expand Up @@ -437,7 +437,7 @@ fun Editor(subId: Int) {
Column {
Row(modifier = Modifier.padding(16.dp)) {
Column {
Text("Edit Value", fontWeight = FontWeight.Medium, fontSize = 24.sp)
Text(stringResource(R.string.edit_value), fontWeight = FontWeight.Medium, fontSize = 24.sp)
Text("${data.key} (${data.fieldName})", modifier = Modifier.padding(top = 6.dp), fontFamily = FontFamily.Monospace)
}
}
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,10 @@
<string name="true_">是</string>
<string name="false_">否</string>
<string name="restart_ims_registration">重新注册IMS</string>
<string name="please_wait">Working on it…</string>
<string name="please_wait">请稍后…</string>
<string name="expert_mode">专家模式</string>
<string name="loading">加载中...</string>
<string name="loaded">已加载 %1$s 共 %2$s</string>
<string name="edit_value">更改值</string>
<string name="search">搜索</string>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@
<string name="false_">No</string>
<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="loaded">Loaded %1$s of %2$s</string>
<string name="edit_value">Edit Value</string>
<string name="search">Search</string>
</resources>

0 comments on commit 6a07df0

Please sign in to comment.