Skip to content

Commit aad1786

Browse files
authored
Add German Android localizations (#929)
* Add German string resources for the Android UI, demo app, core notification channel, and car app modules. Move demo simulation status labels into string resources so they can be localized, and enable generated locale config for the demo app with English as the default resource locale. * style: fix trailing whitespace in NotNavigatingOverlay.kt * chore: ignore German Android resource files in typos configuration * Add dot string resource to German translations
1 parent 9896d8c commit aad1786

9 files changed

Lines changed: 62 additions & 8 deletions

File tree

_typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extend-exclude = [
1111
"**/dist/*",
1212
"guide/**/*.js",
1313
"**/fixtures/*",
14+
"android/**/src/main/res/values-de*/*",
1415
"react-native/cpp/generated/*",
1516
"react-native/src/generated/*",
1617
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="stop_nav">Stopp</string>
4+
<string name="notification_description">Schrittweise Navigationsführung</string>
5+
</resources>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="notification_channel_description">Navigationshinweise</string>
4+
</resources>

android/demo-app/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ android {
4343
buildFeatures {
4444
compose true
4545
}
46+
androidResources {
47+
generateLocaleConfig true
48+
}
4649
packagingOptions {
4750
resources {
4851
excludes += '/META-INF/{AL2.0,LGPL2.1}'

android/demo-app/src/main/java/com/stadiamaps/ferrostar/NotNavigatingOverlay.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,24 @@ fun NotNavigatingOverlay(
8787
bottomEnd = {
8888
Column(modifier = Modifier.padding(bottom = 24.dp), horizontalAlignment = Alignment.End) {
8989
Button({ viewModel.toggleSimulation() }) {
90-
val nextLocation =
90+
val nextLocationText =
9191
if (!isSimulating) {
92-
"simulated"
92+
stringResource(R.string.set_location_to_simulated)
9393
} else {
94-
"GPS"
94+
stringResource(R.string.set_location_to_gps)
9595
}
96-
Text("Set location to $nextLocation")
96+
Text(nextLocationText)
9797
}
9898

99-
val currentLocation =
99+
val currentLocationText =
100100
if (isSimulating) {
101-
"simulated"
101+
stringResource(R.string.location_is_simulated)
102102
} else {
103-
"GPS"
103+
stringResource(R.string.location_is_gps)
104104
}
105105

106106
Text(
107-
"Location is $currentLocation",
107+
currentLocationText,
108108
style =
109109
MaterialTheme.typography.titleSmall.copy(
110110
color = MaterialTheme.colorScheme.onTertiary,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unqualifiedResLocale=en
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name">Ferrostar Demo App</string>
4+
<string name="dropped_pin_title">Gesetzte Markierung</string>
5+
<string name="destination_coordinates">Koordinaten: %1$s</string>
6+
<string name="start_navigation">Navigation starten</string>
7+
<string name="close_destination_sheet">Schließen</string>
8+
<string name="center_on_my_location">Auf meinen Standort zentrieren</string>
9+
<string name="set_location_to_simulated">Simulierten Standort verwenden</string>
10+
<string name="set_location_to_gps">GPS-Standort verwenden</string>
11+
<string name="location_is_simulated">Standort: simuliert</string>
12+
<string name="location_is_gps">Standort: GPS</string>
13+
</resources>

android/demo-app/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
<string name="start_navigation">Start navigation</string>
66
<string name="close_destination_sheet">Close</string>
77
<string name="center_on_my_location">Center on my location</string>
8+
<string name="set_location_to_simulated">Set location to simulated</string>
9+
<string name="set_location_to_gps">Set location to GPS</string>
10+
<string name="location_is_simulated">Location is simulated</string>
11+
<string name="location_is_gps">Location is GPS</string>
812
</resources>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="recenter">Karte zentrieren</string>
4+
<string name="unmute_description">Stummschaltung aufheben</string>
5+
<string name="mute_description">Stummschalten</string>
6+
<string name="zoom_in">Vergrößern</string>
7+
<string name="zoom_out">Verkleinern</string>
8+
<string name="arrival">Ankunft</string>
9+
<string name="distance">Distanz</string>
10+
<string name="duration">Dauer</string>
11+
<string name="end_navigation">Navigation beenden</string>
12+
<string name="maneuver_image">Bild der Fahranweisung</string>
13+
<string name="stop_navigation">Navigation beenden</string>
14+
<string name="maneuver_instruction_image">Bild der Navigationsanweisung</string>
15+
<string name="dot">•</string>
16+
<string name="instruction_image">Bild der Anweisung</string>
17+
<string name="preparing">Wird vorbereitet…</string>
18+
<string name="arrived_title">Angekommen</string>
19+
<string name="arrived_description">Sie haben Ihr Ziel erreicht.</string>
20+
<string name="route_overview">Routenübersicht</string>
21+
<string name="speed">Tempo</string>
22+
<string name="limit">Limit</string>
23+
</resources>

0 commit comments

Comments
 (0)