Skip to content

Commit a390146

Browse files
committed
update translations
1 parent 46417da commit a390146

6 files changed

Lines changed: 23 additions & 10 deletions

File tree

app/src/main/java/indi/dmzz_yyhyy/lightnovelreader/LightNovelReaderApplication.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import dagger.hilt.android.HiltAndroidApp
55

66
@HiltAndroidApp
77
class LightNovelReaderApplication: Application(){
8-
9-
10-
118
override fun onCreate() {
129
super.onCreate()
1310
}

app/src/main/java/indi/dmzz_yyhyy/lightnovelreader/data/web/LightNovelReaderWebAPI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class LightNovelReaderWebAPI @Inject constructor() {
139139
val dataCall: Call<ResponseBody> = service.getUpdateApk()
140140

141141
val data: Response<ResponseBody>? = dataCall.execute()
142-
println("老子tm下好了!")
142+
Log.w("API","老子tm下好了!")
143143
data?.body()
144144
} catch (error: Exception){
145145
error.localizedMessage?.let { Log.e("API", it) }

app/src/main/java/indi/dmzz_yyhyy/lightnovelreader/ui/components/UpdateAlerDialog.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import androidx.compose.material3.Icon
88
import androidx.compose.material3.Text
99
import androidx.compose.material3.TextButton
1010
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.res.stringResource
12+
import indi.dmzz_yyhyy.lightnovelreader.R
1113

1214
@Composable
1315
fun UpdateAlertDialog(
@@ -35,7 +37,7 @@ fun UpdateAlertDialog(
3537
onConfirmation()
3638
}
3739
) {
38-
Text("升级")
40+
Text(stringResource(id = R.string.update_confirm))
3941
}
4042
},
4143
dismissButton = {
@@ -44,7 +46,7 @@ fun UpdateAlertDialog(
4446
onDismissRequest()
4547
}
4648
) {
47-
Text("忽略")
49+
Text(stringResource(id = R.string.update_dismiss))
4850
}
4951
}
5052
)

app/src/main/java/indi/dmzz_yyhyy/lightnovelreader/ui/home/HomeActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ class HomeActivity : ComponentActivity() {
7575
}
7676
}}
7777
},
78-
dialogTitle = "有新的更新可用",
79-
dialogText = "服务端上有更新的客户端版本,我们建议恁进行升级.",
78+
dialogTitle = stringResource(id = R.string.new_update_available),
79+
dialogText = stringResource(id = R.string.new_update_available_text),
8080
)
8181
}
8282
if (isDownloadingUpdate.value) {
8383
AlertDialog(
8484
icon = { Icon(Icons.Default.Download, contentDescription = "download") },
85-
title = { Text("正在下载", style = MaterialTheme.typography.headlineSmall) },
86-
text = { Text("正在从客户端获取数据,请稍等...") },
85+
title = { Text(stringResource(id = R.string.downloading), style = MaterialTheme.typography.headlineSmall) },
86+
text = { Text(stringResource(id = R.string.downloading_text)) },
8787
onDismissRequest = {},
8888
confirmButton = {},
8989
dismissButton = {}

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<string name="last_read">上次阅读: %s</string>
88
<string name="current_reading">当前阅读: %s</string>
99
<string name="last_reading_time">上次阅读时间: %s</string>
10+
<string name="new_update_available">有新的更新可用</string>
11+
<string name="new_update_available_text">服务端上有更新的客户端版本,我们建议您进行升级。</string>
1012
<string name="contents">目录</string>
1113
<string name="chapters">章节</string>
1214
<string name="volumes">卷</string>
@@ -29,4 +31,8 @@
2931
<string name="desc_cover">封面</string>
3032
<string name="desc_icon_image">图标</string>
3133
<string name="desc_search">搜索</string>
34+
<string name="downloading">正在下载…</string>
35+
<string name="downloading_text">正在从服务端获取数据,请稍等...</string>
36+
<string name="update_confirm">升级</string>
37+
<string name="update_dismiss">忽略</string>
3238
</resources>

app/src/main/res/values/strings.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,12 @@
3030
<string name="desc_cover">cover</string>
3131
<string name="desc_icon_image">icon image</string>
3232
<string name="desc_search">search</string>
33+
<string name="new_update_available">New update available</string>
34+
<string name="new_update_available_text">A new version of the application is available, we recommend you to
35+
update.
36+
</string>
37+
<string name="downloading">Downloading</string>
38+
<string name="downloading_text">Downloading from server...</string>
39+
<string name="update_confirm">Update</string>
40+
<string name="update_dismiss">Dismiss</string>
3341
</resources>

0 commit comments

Comments
 (0)