Skip to content

Commit

Permalink
Localize app into German (de-DE)
Browse files Browse the repository at this point in the history
Includes externalization of a few strings and added ome details on the preferences screen.

The Android feature of per-app language selection is currently not supported.
  • Loading branch information
meikpiep committed Nov 18, 2023
1 parent 5dc1ef9 commit 5192697
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 37 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add German localization.

### Changed

### Deprecated
Expand Down
1 change: 1 addition & 0 deletions gauguin-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ android {
applicationId = "org.piepmeyer.gauguin"
minSdk = 24
targetSdk = 34
resourceConfigurations += setOf("en-rUS", "de-rDE")
}

applicationVariants.all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.view.View.OnTouchListener
import com.google.android.material.color.MaterialColors
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import org.piepmeyer.gauguin.R
import org.piepmeyer.gauguin.game.Game
import org.piepmeyer.gauguin.grid.Grid
import org.piepmeyer.gauguin.grid.GridCell
Expand Down Expand Up @@ -175,10 +176,12 @@ class GridUI : View, OnTouchListener, GridView, KoinComponent {
val textPaint = paintHolder.previewBannerTextPaint()
textPaint.textSize = cageTextSize.toFloat()

var previewText = "Preview"
if (previewStillCalculating) {
previewText += "..."
}
val previewText = if (previewStillCalculating) {
resources.getText(R.string.new_grid_preview_banner_still_calculating)
} else {
resources.getText(R.string.new_grid_preview_banner_already_calculated)
}.toString()

previewPath.offset(padding.first.toFloat(), padding.second.toFloat())

canvas.drawPath(previewPath, paintHolder.previewBannerBackgroundPaint())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class MainActivity : AppCompatActivity(), GridCreationListener {
}
Snackbar.make(binding.hintOrNewGame, text, duration)
.setAnchorView(binding.hintOrNewGame)
.setAction("Undo") {
.setAction(resources.getText(R.string.hint_as_toast_undo_last_step)) {
game.restoreUndo()
binding.gridview.invalidate()
checkProgressOrStartNewGame()
Expand All @@ -419,7 +419,7 @@ class MainActivity : AppCompatActivity(), GridCreationListener {


fun gameSaved() {
Snackbar.make(binding.hintOrNewGame, "Game saved sucessfully.", Snackbar.LENGTH_LONG)
Snackbar.make(binding.hintOrNewGame, resources.getText(R.string.main_activity_current_game_saved), Snackbar.LENGTH_LONG)
.setAnchorView(binding.hintOrNewGame)
.show()
}
Expand Down
6 changes: 3 additions & 3 deletions gauguin-app/src/main/res/menu/bottom_app_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
android:id="@+id/undo"
app:showAsAction="always"
android:icon="@drawable/baseline_undo_24"
android:title="Hint" />
android:title="@string/main_activity_manu_item_undo_one_step"/>

<item android:id="@+id/eraser"
android:title="Erase Cell"
android:title="@string/game_erase_selected_cell"
android:icon="@drawable/outline_clear_24"
app:showAsAction="ifRoom" />

Expand Down Expand Up @@ -37,7 +37,7 @@

<item
android:id="@+id/menu_swap_keypad"
android:title="Swap key pad"
android:title="@string/main_activity_manu_item_swap_key_pad"
android:icon="@drawable/baseline_swap_horiz_24"
app:showAsAction="never" />

Expand Down
8 changes: 8 additions & 0 deletions gauguin-app/src/main/res/values-de-rDE/arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="setting_theme_entries">
<item>Hell</item>
<item>Dunkel</item>
<item>Systemeinstellung</item>
</string-array>
</resources>
109 changes: 109 additions & 0 deletions gauguin-app/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="menu_new">Neues Spiel</string>
<string name="menu_load">Laden</string>
<string name="menu_save">Speichern</string>
<string name="menu_restart_game">Spiel neustarten</string>
<string name="menu_stats">Statistiken</string>
<string name="menu_settings">Einstellungen</string>
<string name="menu_help">Hilfe</string>
<string name="menu_issues">Fehler und Features</string>
<string name="menu_show_mistakes">Zeige Fehler an</string>
<string name="menu_reveal_cell">Decke Zelle auf</string>
<string name="menu_reveal_cage">Decke Gruppe auf</string>
<string name="menu_show_solution">Decke Spiel auf</string>
<string name="dialog_title_load">Spiel laden</string>
<string name="puzzle_solved">Spiel gelöst!</string>
<string name="puzzle_record_time">Neue Bestzeit</string>
<string name="save_games_empty">Keine gespeicherten Spiele gefunden.</string>
<string name="settings_group_assistance">Spielhilfen</string>
<string name="setting_flag_bad_maths_title">Mathematikfehler anzeigen</string>
<string name="setting_flag_duplicates_title">Duplizierte Zahlen hervorheben</string>
<string name="setting_remove_pencils_title">Mögliche Zahlen entfernen</string>
<string name="setting_remove_pencils_summary">Aus der gleichen Zeile und Spalte</string>
<string name="settings_group_display">Anzeige</string>
<string name="setting_theme_title">Design</string>
<string name="setting_pencil_at_start_title">Mögliche Zahlen beim Start</string>
<string name="setting_pencil_3x3_title">Mögliche Zahlen in 3x3-Raster</string>
<string name="setting_pencil_3x3_summary_on">Im 3x3-Raster anzeigen</string>
<string name="setting_pencil_3x3_summary_off">In aufsteigender Reihenfolge anzeigen</string>
<string name="setting_show_timer_title">Zeige Spielzeit an</string>
<string name="setting_show_fullscreen_title">Vollbildmodus</string>
<string name="setting_keep_screen_on_title">Bilschirm aktiviert lassen</string>
<string name="stats_group_title">Statistiken</string>
<string name="stats_puzzles_title">Spielstatistiken</string>
<string name="stats_puzzles_started">Gestartete Spiele</string>
<string name="stats_puzzles_hinted">Mit Hilfe gelöste Spiele</string>
<string name="stats_puzzles_solved">Selbst gelöste Spiele</string>
<string name="stats_puzzles_solved_streak">Aktueller Lauf</string>
<string name="stats_puzzles_longest_streak">Längster Lauf</string>
<string name="stats_clear">Statistiken zurücksetzen</string>
<string name="help_section_title">Hilfe</string>
<string name="help_rules_title">Regeln</string>
<string name="help_rules_summary">Fülle jede Spalte und Zeile mit den zur Verfügung stehenden Zahlen. Jede Zahl muss pro spalte und Zeile exakt einmal vorkommen.\n\nZusätzlich gibt es Zahlengruppen, die jeweils eine Mathematikaufgabe beinhalten, die die Gruppe erfüllen muss. Beispiel: \'5+\' steht für eine Gruppe, bei denen alle Zahlen summiert 5 ergeben müssen.\n\nZahlen können in einer Gruppe mehrfach vorkommen, solange sie nicht in der gleichen Spalte oder Zeile vorkommen.</string>
<string name="help_instructions_title">Bedienung</string>
<string name="help_instructions_summary">Fülle die Zellen mittels der Zahlen-Buttons. Um eine Zahl fest einzutragen, drücke den Button lange. Um eine mögliche Zahl hinzzufügen oder zu entfernen, drücke den Button kurz.\n\nNutze das Fragezeichen, um zu sehen, ob alle bisherigen Zahlen korrekt eingetragen wurden.\n\nDas aktuelle Spiel wird automatisch gespeichert.</string>
<string name="about_section_title">Über</string>
<string name="about_version_title">Version</string>
<string name="about_license_title">Lizenz</string>
<string name="about_license_summary">GNU General Public Lizenz v3</string>
<string name="about_website_title">Homepage</string>
<string name="about_website_summary">Melden Sie Fehler oder Vorschläge unter <a href="https://github.com/meikpiep/gauguin">https://github.com/meikpiep/gauguin</a></string>
<string name="about_developers_title">Entwickler</string>
<string name="about_developers_summary">Meik Piepmeyer\n\nGeforkt von HoloKenMod 1.6.1 von Adam Queler\nGeforkt von Holoken 1.1.1 von Amanda Chow, mit gro0em Dank an Ben Buxton und Stephen Lee von Mathdoku</string>
<string name="about_changelog_title">Changelog</string>
<string name="about_changelog_summary">Siehe <a href="https://github.com/meikpiep/gauguin/releases">https://github.com/meikpiep/gauguin/releases</a></string>
<string name="dialog_ok">OK</string>
<string name="dialog_cancel">Abbrechen</string>
<string name="dialog_restart_title">Spiel neustarten?</string>
<string name="dialog_restart_msg">Spiel wird neu gestartet</string>
<string name="dialog_delete_title">Spiel löschen?</string>
<string name="dialog_delete_msg">Spiel wird gelöscht</string>
<string name="dialog_delete_all_title">Alle Spiele löschen?</string>
<string name="dialog_delete_all_msg">Alle Spiele werden gelöscht</string>
<string name="toast_cheated">Dieses Puzzle scheint nicht leicht zu sein</string>
<string name="simulate_game_solved">Gewonnenes Spiel simulieren</string>
<string name="difficulty_label">Schwierigleitsstufe</string>
<string name="single_cells_usage_label">Einzelgruppen</string>
<string name="operations_label">Rechenoperationen</string>
<string name="digits_label">Zahlen</string>
<string name="show_operators_toggle">Zeige Rechenoperationen an</string>
<string name="difficulty_any">Alle</string>
<string name="difficulty_very_easy">Sehr einfach</string>
<string name="difficulty_easy">Einfach</string>
<string name="difficulty_medium">Mittel</string>
<string name="difficulty_hard">Schwierig</string>
<string name="difficulty_extreme">Sehr schwierig</string>
<string name="single_cages_fixed_number">Feste Anzahl</string>
<string name="single_cages_no_singles">Keine</string>
<string name="single_cages_dynamic">Dynamisch</string>
<string name="digits_primes">Primzahlen</string>
<string name="digits_fibonacci">Fibonacci</string>
<string name="digits_padovan">Padovan</string>
<string name="new_grid_shape_square">Quadrat</string>
<string name="new_grid_shape_rectangular">Rechteck</string>
<string name="new_grid_shape_size">Größe: %1$s</string>
<string name="new_game_activity_start_new_game">Neues Spiel starten</string>
<string name="new_grid_game_options">Spieleinstellungen</string>
<string name="new_grid_options_basic_options">Grundeinstellungen</string>
<string name="new_grid_options_advanced_options">Erweitert</string>
<string name="save_game_action_load">Laden</string>
<string name="save_game_action_delete">Löschen</string>
<string name="hint_as_toast_undo_last_step">Rückgängig</string>

<plurals name="toast_mistakes" tools:ignore="MissingQuantity">
<item quantity="other">%d Fehler</item>
</plurals>
<plurals name="toast_filled">
<item quantity="one">1 gefüllte Zelle</item>
<item quantity="other">%d gefüllte Zellen</item>
</plurals>
<string name="new_grid_preview_banner_already_calculated">Vorschau</string>
<string name="new_grid_preview_banner_still_calculating">Vorschau...</string>
<string name="setting_pencil_at_start_summary_on">Mit gefüllten möglichen Zahlen beginnen</string>
<string name="setting_pencil_at_start_summary_off">Keine möglichen Zahlen beim Spielstart eintragen</string>
<string name="game_erase_selected_cell">Zelle löschen</string>
<string name="main_activity_manu_item_swap_key_pad">Zahlenbereich verschieben</string>
<string name="main_activity_manu_item_undo_one_step">Rückgängig</string>
<string name="main_activity_current_game_saved">Spiel erfolgreich gespeicherrt.</string>
</resources>
45 changes: 17 additions & 28 deletions gauguin-app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Gauguin</string>
<string name="app_name" translatable="false">Gauguin</string>

<string name="menu_new">New Game</string>
<string name="menu_load">Load</string>
Expand All @@ -21,7 +21,7 @@
<string name="puzzle_solved">Puzzle solved!</string>
<string name="puzzle_record_time">New best time - </string>

<string name="time_zero">00:00:00</string>
<string name="time_zero" translatable="false">00:00:00</string>
<string name="save_games_empty">No save games found</string>

<string name="settings_group_assistance">Game Assistance</string>
Expand Down Expand Up @@ -51,48 +51,28 @@

<string name="help_section_title">Help</string>
<string name="help_rules_title">Rules</string>
<string name="help_rules_summary">
Fill in each row and column with numbers from 1 to grid size.
Numbers may only be used once per row and column.
\n\nThick lines indicate \'cages\', where each cage has a math puzzle to be solved.
For example, \'5+\' means all numbers in that cage must add up to 5.
\n\nNumbers may be used more than once per cage, as long as there is only one of each number per row or column.
</string>
<string name="help_rules_summary">Fill in each row and column with the available numbers. Numbers may only be used once per row and column.\n\nThick lines indicate \'cages\', where each cage has a math puzzle to be solved. For example, \'5+\' means all numbers in that cage must add up to 5.\n\nNumbers may be used more than once per cage, as long as there is only one of each number per row or column.</string>
<string name="help_instructions_title">How to play</string>
<string name="help_instructions_summary">
Fill up the grid squares using the number buttons.
To enter a number to the selected cell, long-press the number button.
To add or remove a possible number, just press the number button.
\n\nUse the question mark to see if there are any mistakes in the filled cells.
\n\nGauguin will auto-save your game if you need to stop.
</string>
<string name="help_instructions_summary">"Fill up the grid cells using the number buttons. To enter a number to the selected cell, long-press the number button. To add or remove a possible number, just press the number button.\n\nUse the question mark to see if there are any mistakes in the filled cells.\n\nGauguin will auto-save your game if you need to stop.\n "</string>

<string name="about_section_title">About</string>
<string name="about_version_title">Version</string>
<string name="about_version_name">@string/versionName</string>
<string name="about_version_name" translatable="false">@string/versionName</string>
<string name="about_license_title">License</string>
<string name="about_license_summary">GNU General Public License v3</string>
<string name="about_website_title">Project Home</string>
<string name="about_website_summary">Report any bugs or suggestions at\n<a href="https://github.com/meikpiep/gauguin">https://github.com/meikpiep/gauguin</a></string>
<string name="about_website_summary">Report any bugs or suggestions at <a href="https://github.com/meikpiep/gauguin">https://github.com/meikpiep/gauguin</a></string>
<string name="about_developers_title">Developer</string>
<string name="about_developers_summary">
Meik Piepmeyer
\n\nForked from HoloKenMod 1.6.1 by Adam Queler
\nForked from Holoken 1.1.1 by Amanda Chow, with much credit to Ben Buxton and Stephen Lee of Mathdoku</string>
<string name="about_developers_summary">Meik Piepmeyer\n \nForked from HoloKenMod 1.6.1 by Adam Queler\n\nForked from Holoken 1.1.1 by Amanda Chow, with much credit to Ben Buxton and Stephen Lee of Mathdoku</string>
<string name="about_changelog_title">Changelog</string>
<string name="about_changelog_summary">
See <a href="https://github.com/meikpiep/gauguin/releases">https://github.com/meikpiep/gauguin/releases</a>
</string>
<string name="about_changelog_summary">See <a href="https://github.com/meikpiep/gauguin/releases">https://github.com/meikpiep/gauguin/releases</a></string>

<string name="dialog_ok">OK</string>
<string name="dialog_cancel">Cancel</string>

<string name="dialog_restart_title">Restart game?</string>
<string name="dialog_restart_msg">This game will be restarted</string>

<string name="dialog_delete_title">Delete game?</string>
<string name="dialog_delete_msg">This game will be deleted</string>

<string name="dialog_delete_all_title">Delete all games?</string>
<string name="dialog_delete_all_msg">All games will be deleted</string>

Expand Down Expand Up @@ -132,6 +112,9 @@
<string name="new_grid_options_advanced_options">Advanced</string>
<string name="save_game_action_load">Load</string>
<string name="save_game_action_delete">Delete</string>
<string name="hint_as_toast_undo_last_step">Undo</string>
<string name="new_grid_preview_banner_already_calculated">Preview</string>
<string name="new_grid_preview_banner_still_calculating">Preview...</string>

<plurals name="toast_mistakes">
<item quantity="one">1 mistake</item>
Expand All @@ -141,4 +124,10 @@
<item quantity="one">1 filled cell</item>
<item quantity="other">%d filled cells</item>
</plurals>
<string name="setting_pencil_at_start_summary_on">Begin with filled pencil marks</string>
<string name="setting_pencil_at_start_summary_off">Empty pencil marks at start</string>
<string name="game_erase_selected_cell">Erase Cell</string>
<string name="main_activity_manu_item_swap_key_pad">Swap key pad</string>
<string name="main_activity_manu_item_undo_one_step">Undo</string>
<string name="main_activity_current_game_saved">Game saved successfully.</string>
</resources>
2 changes: 2 additions & 0 deletions gauguin-app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<CheckBoxPreference
android:key="pencilatstart"
android:title="@string/setting_pencil_at_start_title"
android:summaryOn="@string/setting_pencil_at_start_summary_on"
android:summaryOff="@string/setting_pencil_at_start_summary_off"
android:defaultValue="false" />
<CheckBoxPreference
android:key="pencil3x3"
Expand Down

0 comments on commit 5192697

Please sign in to comment.