Skip to content

Commit

Permalink
- add german translations
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo03v committed Oct 2, 2023
1 parent a195b3a commit c40e027
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ data class OverloadTopLevelDestination(
val selectedIcon: ImageVector,
val unselectedIcon: ImageVector,
val iconTextId: Int,
val label: String,
)

class OverloadNavigationActions(private val navController: NavHostController) {
Expand Down Expand Up @@ -51,20 +50,17 @@ val TOP_LEVEL_DESTINATIONS = listOf(
selectedIcon = Icons.Filled.CalendarToday,
unselectedIcon = Icons.Outlined.CalendarToday,
iconTextId = R.string.home,
label = "Home",
),
OverloadTopLevelDestination(
route = OverloadRoute.CALENDAR,
selectedIcon = Icons.Filled.CalendarMonth,
unselectedIcon = Icons.Outlined.CalendarMonth,
iconTextId = R.string.calendar,
label = "Calendar",
),
OverloadTopLevelDestination(
route = OverloadRoute.CONFIGURATIONS,
selectedIcon = Icons.Filled.Settings,
unselectedIcon = Icons.Outlined.Settings,
iconTextId = R.string.configurations,
label = "Configurations",
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,14 @@ fun OverloadBottomNavigationBar(
)
},
label = {
val label = when (overloadDestination.route) {
"Home" -> { stringResource(id = R.string.home) }
"Calendar" -> { stringResource(id = R.string.calendar) }
"Configurations" -> { stringResource(id = R.string.configurations) }
else -> { stringResource(id = R.string.unknown_day) }
}
TextView(
text = overloadDestination.label,
text = label,
fontSize = MaterialTheme.typography.labelLarge.fontSize,
fontWeight =
if (selectedDestination == overloadDestination.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -491,7 +492,7 @@ fun ConfigurationTitle(
fun ConfigurationDescription(
text: String,
) {
TextView(
Text(
text = text,
fontSize = MaterialTheme.typography.bodyMedium.fontSize,
color = MaterialTheme.colorScheme.onBackground,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,9 @@ fun ConfigurationsTabItem(
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.padding(horizontal = 8.dp),
)
Row(
modifier = Modifier.fillMaxWidth(),
) {
Column {
ConfigurationTitle(title)
ConfigurationDescription(description)
}
Column() {
ConfigurationTitle(title)
ConfigurationDescription(description)
}
}
}
Expand Down Expand Up @@ -99,7 +95,7 @@ fun ConfigurationsTabItem(
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier.fillMaxWidth(),
) {
Column {
Column(modifier = Modifier.weight(1f)) {
ConfigurationTitle(title)
ConfigurationDescription(description)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fun ConfigurationsTabPauseGoalDialog(onClose: () -> Unit) {
hours = it.toIntOrNull()
},
singleLine = true,
suffix = { Text(text = "hours") },
suffix = { Text(text = stringResource(R.string.hours)) },
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Number,
),
Expand All @@ -100,7 +100,7 @@ fun ConfigurationsTabPauseGoalDialog(onClose: () -> Unit) {
minutes = it.toIntOrNull()
},
singleLine = true,
suffix = { Text(text = "minutes") },
suffix = { Text(text = stringResource(R.string.minutes)) },
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Number,
),
Expand Down Expand Up @@ -144,7 +144,7 @@ fun ConfigurationsTabPauseGoalDialog(onClose: () -> Unit) {
disabledContentColor = MaterialTheme.colorScheme.onSurface,
),
) {
Text(text = "Cancel")
Text(text = stringResource(R.string.cancel))
}
},
modifier = Modifier.padding(16.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fun ConfigurationsTabWorkGoalDialog(onClose: () -> Unit) {
hours = it.toIntOrNull()
},
singleLine = true,
suffix = { Text(text = "hours") },
suffix = { Text(text = stringResource(R.string.hours)) },
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Number,
),
Expand All @@ -100,7 +100,7 @@ fun ConfigurationsTabWorkGoalDialog(onClose: () -> Unit) {
minutes = it.toIntOrNull()
},
singleLine = true,
suffix = { Text(text = "minutes") },
suffix = { Text(text = stringResource(R.string.minutes)) },
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Number,
),
Expand Down Expand Up @@ -144,7 +144,7 @@ fun ConfigurationsTabWorkGoalDialog(onClose: () -> Unit) {
disabledContentColor = MaterialTheme.colorScheme.onSurface,
),
) {
Text(text = "Cancel")
Text(text = stringResource(R.string.cancel))
}
},
modifier = Modifier.padding(16.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fun HomeTabProgress(
Column(
modifier = Modifier.padding(horizontal = 10.dp),
) {
TextView(title)
TextView(title, maxLines = 2)
TextView(subtitle)
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/cloud/pablos/overload/ui/views/TextView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ fun TextView(
fontWeight: FontWeight = FontWeight.Normal,
color: Color = Color.Unspecified,
align: TextAlign = TextAlign.Left,
maxLines: Int = 1
) {
Text(
text = text,
fontSize = fontSize,
fontWeight = fontWeight,
color = color,
maxLines = 1,
maxLines = maxLines,
overflow = TextOverflow.Ellipsis,
textAlign = align,
modifier = modifier,
Expand Down
91 changes: 91 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="select_all_items_of_selected_day">wähle alle Einträge des ausgewählten Tages aus</string>
<string name="storage">Speicher</string>
<string name="delete_pause_descr">Du kannst diese laufende Pause nicht löschen. Sie dient nur dazu, anzuzeigen, dass eine Pause erstellt wird, sobald du auf „Start“ drückst. Wenn du bis morgen nicht auf „Start“ drückst, wird sie verschwinden und hat daher keinen Einfluss auf dein Ziel.</string>
<string name="close">Schließen</string>
<string name="save">Speichern</string>
<string name="goals">Ziele</string>
<string name="system_logs_descr">Füge dem Absturzberichte meinen Systembericht hinzu</string>
<string name="crash_reports_descr">Frage danach Absturzberichte zu senden</string>
<string name="get_out_of_isDeleting">deaktiviert den Löschmodus</string>
<string name="system_logs">Systemberichte</string>
<string name="backup_descr">Speichere regelmäßig Sicherheitskopien an einem sicheren Ort!</string>
<string name="friday">Freitag</string>
<string name="tuesday">Dienstag</string>
<string name="acra_toastText">Absturz erkannt. Bitte helfe mit dem Senden einer E-Mail!</string>
<string name="import_descr">Stelle Daten aus einer Sicherung her</string>
<string name="import_backup">Sicherung wiederherstellen</string>
<string name="learn_more">Mehr erfahren…</string>
<string name="sourcecode_descr">Möchtest du das Innere sehen\? Nur zu!</string>
<string name="pause">Pause</string>
<string name="delete_items_forever">Einträge für immer löschen</string>
<string name="edit">Bearbeiten</string>
<string name="pick_work_goal">Arbeitsziel setzen</string>
<string name="acra_mailBody">Absturz erkannt. Bitte helfe uns, uns zu verbessern, indem du diese E-Mail sendest, damit wir das Problem so schnell wie möglich beheben können.
\nBitte entschuldige! Das Absenden ist für die Behebung dieses Problems unerlässlich.
\n
\nBeschreibung – Was hast du getan, bevor die App abstürzte\?
\n
\n
\nSchritte zur Reproduktion – Kannst du beschreiben, wie wir den Fehler reproduzieren können\?
\n
\n
\nBildmaterial – Bitte füge Screenshots oder Bildschirmaufzeichnungen bei.
\n
\n
\nKürzliche Änderungen – Hast du kürzlich die App aktualisiert oder Geräteeinstellungen geändert\?
\n
\n
\nHäufigkeit – Wie oft kommt dieser Absturz vor\?
\n
\n
\nDanke für deine Geduld!</string>
<string name="wednesday">Mittwoch</string>
<string name="monday">Montag</string>
<string name="unknown_day">Unbekannter Tag</string>
<string name="start">Start</string>
<string name="license_descr">GNU GPL v3</string>
<string name="issue_reports">Fehler melden</string>
<string name="stop">Stop</string>
<string name="import_failure">Sicherung konnte nicht wiederhergestellt werden</string>
<string name="select_year">Jahr auswählen</string>
<string name="pick_pause_goal">Pausenziel setzen</string>
<string name="work">Arbeit</string>
<string name="backup">Sichern</string>
<string name="license">Lizenz</string>
<string name="issue_reports_descr">Ist etwas komisch\? Melde es!</string>
<string name="about">Über</string>
<string name="work_goal_descr">Setze für die Arbeit ein Ziel</string>
<string name="acra_mailTo">[email protected]</string>
<string name="open_link_with">Öffne den Link mit</string>
<string name="import_backup_descr">Um Daten in die App zu importieren, benutze bitte das Sharesheet von anderen Apps. Damit kann die App sicher auf die freigegebenen Daten zugreifen und diese in Ihre Datenbank importieren.</string>
<string name="configurations">Konfigurationen</string>
<string name="sunday">Sonntag</string>
<string name="no_items_subtitle">Es gibt für diesen Tag keine Einträge.</string>
<string name="crash_reports">Absturzberichte</string>
<string name="home">Startseite</string>
<string name="yesterday">Gestern</string>
<string name="navigation_drawer">Navigationsleiste</string>
<string name="arrow_forward">Pfeil nach vorne, der die Richtung beider Zeiten von Anfang bis Ende beschreibt</string>
<string name="delete_pause">Pause löschen</string>
<string name="deselect_all_items_of_selected_day">wähle alle Einträge des ausgewählten Tages ab</string>
<string name="analytics">Analysen</string>
<string name="no_items_title">Keine Einträge gefunden</string>
<string name="saturday">Samstag</string>
<string name="work_left">Übrige Arbeitszeit</string>
<string name="sourcecode">Quellcode</string>
<string name="itemCount_selected">ausgewählt</string>
<string name="import_success">Sicherung erfolgreich wiederhergestellt</string>
<string name="pause_goal_descr">Setze ein Ziel für deine Pausen</string>
<string name="thursday">Donnerstag</string>
<string name="footer">mit ❤️ von pabloscloud erstellt</string>
<string name="calendar">Kalender</string>
<string name="today">Heute</string>
<string name="pause_left">Übrige Pause</string>
<string name="import_ol">Wiederherstellen</string>
<string name="unknown_tab">Unbekannter Tab</string>
<string name="hours">Stunden</string>
<string name="minutes">Minuten</string>
<string name="cancel">Abbrechen</string>
</resources>
9 changes: 7 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
the License.
-->
<resources>
<string name="app_name">Overload</string>
<string name="app_name" translatable="false">Overload</string>
<string name="navigation_drawer">Navigation Drawer</string>

<!-- cloud.pablos.overload.ui.tabs.home.HomeTab -->
Expand Down Expand Up @@ -85,7 +85,7 @@
<string name="footer">created with ❤️ by pabloscloud</string>
<string name="acra_toastText">Crash detected. Please help by sending a mail!</string>
<string name="acra_mailTo">[email protected]</string>
<string name="acra_mailSubject">Overload Crash</string>
<string name="acra_mailSubject" translatable="false">Overload Crash</string>
<string name="acra_mailBody">
Crash detected. Please help us improve by sending this email, so we can get this fixed as soon as possible.\n
Sorry for the inconveniences caused! Your input is essential for fixing this issue.\n
Expand All @@ -111,6 +111,9 @@
<!-- cloud.pablos.overload.ui.tabs.configurations.ConfigurationsTabWorkGoalDialog -->
<string name="save">Save</string>
<string name="pick_work_goal">Set Work Goal</string>
<string name="hours">hours</string>
<string name="minutes">minutes</string>
<string name="cancel">cancel</string>

<!-- cloud.pablos.overload.ui.tabs.configurations.ConfigurationsTabPauseGoalDialog -->
<string name="pick_pause_goal">Set Pause Goal</string>
Expand All @@ -125,4 +128,6 @@
<string name="edit">Edit</string>

<string name="select_year">Select Year</string>

<string name="unknown_tab">Unknown tab</string>
</resources>

0 comments on commit c40e027

Please sign in to comment.