Skip to content

Commit acf2b9b

Browse files
authored
android(i18n): added ukrainian translation (#245)
feat(i18n): added ukrainian translation with extracting of some string to resources. Auto generation of locale config
1 parent 34f6069 commit acf2b9b

File tree

7 files changed

+242
-17
lines changed

7 files changed

+242
-17
lines changed

android/app/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ android {
3838
compose = true
3939
viewBinding = true
4040
}
41+
androidResources {
42+
generateLocaleConfig = true
43+
}
4144
externalNativeBuild {
4245
cmake {
4346
path = file("src/main/cpp/CMakeLists.txt")

android/app/src/main/java/me/kavishdevar/librepods/screens/AccessibilitySettingsScreen.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ fun AccessibilitySettingsScreen(navController: NavController) {
160160
val mediaEQEnabled = remember { mutableStateOf(false) }
161161

162162
val pressSpeedOptions = mapOf(
163-
0.toByte() to "Default",
164-
1.toByte() to "Slower",
165-
2.toByte() to "Slowest"
163+
0.toByte() to stringResource(R.string.default_option),
164+
1.toByte() to stringResource(R.string.slower),
165+
2.toByte() to stringResource(R.string.slowest)
166166
)
167167
val selectedPressSpeedValue =
168168
aacpManager?.controlCommandStatusList?.find { it.identifier == AACPManager.Companion.ControlCommandIdentifiers.DOUBLE_CLICK_INTERVAL }?.value?.takeIf { it.isNotEmpty() }
@@ -196,9 +196,9 @@ fun AccessibilitySettingsScreen(navController: NavController) {
196196
}
197197

198198
val pressAndHoldDurationOptions = mapOf(
199-
0.toByte() to "Default",
200-
1.toByte() to "Slower",
201-
2.toByte() to "Slowest"
199+
0.toByte() to stringResource(R.string.default_option),
200+
1.toByte() to stringResource(R.string.slower),
201+
2.toByte() to stringResource(R.string.slowest)
202202
)
203203
val selectedPressAndHoldDurationValue =
204204
aacpManager?.controlCommandStatusList?.find { it.identifier == AACPManager.Companion.ControlCommandIdentifiers.CLICK_HOLD_INTERVAL }?.value?.takeIf { it.isNotEmpty() }
@@ -234,9 +234,9 @@ fun AccessibilitySettingsScreen(navController: NavController) {
234234
}
235235

236236
val volumeSwipeSpeedOptions = mapOf(
237-
1.toByte() to "Default",
238-
2.toByte() to "Longer",
239-
3.toByte() to "Longest"
237+
1.toByte() to stringResource(R.string.default_option),
238+
2.toByte() to stringResource(R.string.longer),
239+
3.toByte() to stringResource(R.string.longest)
240240
)
241241
val selectedVolumeSwipeSpeedValue =
242242
aacpManager?.controlCommandStatusList?.find { it.identifier == AACPManager.Companion.ControlCommandIdentifiers.VOLUME_SWIPE_INTERVAL }?.value?.takeIf { it.isNotEmpty() }
@@ -322,7 +322,7 @@ fun AccessibilitySettingsScreen(navController: NavController) {
322322
label = stringResource(R.string.press_speed),
323323
description = stringResource(R.string.press_speed_description),
324324
options = pressSpeedOptions.values.toList(),
325-
selectedOption = selectedPressSpeed?: "Default",
325+
selectedOption = selectedPressSpeed?: stringResource(R.string.default_option),
326326
onOptionSelected = { newValue ->
327327
selectedPressSpeed = newValue
328328
aacpManager?.sendControlCommand(
@@ -340,7 +340,7 @@ fun AccessibilitySettingsScreen(navController: NavController) {
340340
label = stringResource(R.string.press_and_hold_duration),
341341
description = stringResource(R.string.press_and_hold_duration_description),
342342
options = pressAndHoldDurationOptions.values.toList(),
343-
selectedOption = selectedPressAndHoldDuration?: "Default",
343+
selectedOption = selectedPressAndHoldDuration?: stringResource(R.string.default_option),
344344
onOptionSelected = { newValue ->
345345
selectedPressAndHoldDuration = newValue
346346
aacpManager?.sendControlCommand(
@@ -403,7 +403,7 @@ fun AccessibilitySettingsScreen(navController: NavController) {
403403
label = stringResource(R.string.volume_swipe_speed),
404404
description = stringResource(R.string.volume_swipe_speed_description),
405405
options = volumeSwipeSpeedOptions.values.toList(),
406-
selectedOption = selectedVolumeSwipeSpeed?: "Default",
406+
selectedOption = selectedVolumeSwipeSpeed?: stringResource(R.string.default_option),
407407
onOptionSelected = { newValue ->
408408
selectedVolumeSwipeSpeed = newValue
409409
aacpManager?.sendControlCommand(

android/app/src/main/java/me/kavishdevar/librepods/screens/AirPodsSettingsScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ fun AirPodsSettingsScreen(dev: BluetoothDevice?, service: AirPodsService,
384384
.fillMaxWidth(0.9f)
385385
) {
386386
Text(
387-
text = "Troubleshoot Connection",
387+
text = stringResource(R.string.troubleshooting),
388388
style = TextStyle(
389389
fontSize = 16.sp,
390390
fontWeight = FontWeight.Medium,

android/app/src/main/java/me/kavishdevar/librepods/screens/PressAndHoldSettingsScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fun LongPress(navController: NavController, name: String) {
186186
listeningModeItems.add(
187187
SelectItem(
188188
name = stringResource(R.string.off),
189-
description = "Turns off noise management",
189+
description = stringResource(R.string.listening_mode_off_description),
190190
iconRes = R.drawable.noise_cancellation,
191191
selected = (currentByte and 0x01) != 0,
192192
onClick = {
@@ -212,7 +212,7 @@ fun LongPress(navController: NavController, name: String) {
212212
listeningModeItems.addAll(listOf(
213213
SelectItem(
214214
name = stringResource(R.string.transparency),
215-
description = "Lets in external sounds",
215+
description = stringResource(R.string.listening_mode_transparency_description),
216216
iconRes = R.drawable.transparency,
217217
selected = (currentByte and 0x04) != 0,
218218
onClick = {
@@ -235,7 +235,7 @@ fun LongPress(navController: NavController, name: String) {
235235
),
236236
SelectItem(
237237
name = stringResource(R.string.adaptive),
238-
description = "Dynamically adjust external noise",
238+
description = stringResource(R.string.listening_mode_adaptive_description),
239239
iconRes = R.drawable.adaptive,
240240
selected = (currentByte and 0x08) != 0,
241241
onClick = {
@@ -258,7 +258,7 @@ fun LongPress(navController: NavController, name: String) {
258258
),
259259
SelectItem(
260260
name = stringResource(R.string.noise_cancellation),
261-
description = "Blocks out external sounds",
261+
description = stringResource(R.string.listening_mode_noise_cancellation_description),
262262
iconRes = R.drawable.noise_cancellation,
263263
selected = (currentByte and 0x02) != 0,
264264
onClick = {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unqualifiedResLocale=en

0 commit comments

Comments
 (0)