yahtzee-py/models/i18n.py

236 lines
11 KiB
Python
Raw Normal View History

2026-11-02 21:43:42 +00:00
CURRENT_LANG = "DE"
2026-11-02 18:32:36 +00:00
TEXTS = {
2026-11-02 21:43:42 +00:00
"DE": {
# --- Kategorien ---
"cat_1": "Einser", "1": "Einser", "Ones": "Einser",
"cat_2": "Zweier", "2": "Zweier", "Twos": "Zweier",
"cat_3": "Dreier", "3": "Dreier", "Threes": "Dreier",
"cat_4": "Vierer", "4": "Vierer", "Fours": "Vierer",
"cat_5": "Fünfer", "5": "Fünfer", "Fives": "Fünfer",
"cat_6": "Sechser", "6": "Sechser", "Sixes": "Sechser",
"cat_3k": "Dreierpasch", "cat_3K": "Dreierpasch", "3K": "Dreierpasch", "Three of a Kind": "Dreierpasch",
"cat_4k": "Viererpasch", "cat_4K": "Viererpasch", "4K": "Viererpasch", "Four of a Kind": "Viererpasch",
"cat_fh": "Full House", "cat_FH": "Full House", "FH": "Full House", "Full House": "Full House",
"cat_ss": "Kleine Straße", "cat_SS": "Kleine Straße", "SS": "Kleine Straße", "Small Straight": "Kleine Straße",
"cat_ls": "Große Straße", "cat_LS": "Große Straße", "LS": "Große Straße", "Large Straight": "Große Straße",
"cat_y": "Yahtzee", "cat_Y": "Yahtzee", "Y": "Yahtzee", "Yahtzee": "Yahtzee",
"cat_ch": "Chance", "cat_CH": "Chance", "CH": "Chance", "Chance": "Chance",
# --- Hauptmenü & Login ---
"login_btn": "Login",
"new_profile_btn": "Neues Profil",
"soul_label": "Seele: {0}",
"menu_resume": "Spiel fortsetzen",
2026-11-02 18:32:36 +00:00
"menu_play": "Gegen Computer spielen",
2026-11-02 21:43:42 +00:00
"menu_lang": "Sprache / Language (DE)",
2026-11-02 18:32:36 +00:00
"menu_stats": "Statistiken",
"menu_exit": "Beenden",
2026-11-02 21:43:42 +00:00
# --- Spieleinstellungen & Bots ---
"setup_title": "Spieleinstellungen",
"opponent_label": "Gegner {0}:",
"none_bot": "Keiner",
"bot_default_name": "Bot {0}",
"start_ritual_btn": "Das Ritual beginnen",
"back_btn": "Zurück",
"bot_level_0": "Stufe 0: Zufall",
"bot_level_1": "Stufe 1: Simpel",
"bot_level_2": "Stufe 2: Solide",
"bot_level_3": "Stufe 3: Stark",
"bot_level_4": "Stufe 4: Experte",
"bot_level_5": "Stufe 5: Großmeister",
# --- Spielbrett (BoardView) ---
"btn_save_quit": "Speichern & Beenden",
"btn_menu": "Menü",
"btn_help": "Hilfe",
"your_dice": "Deine Würfel",
"btn_roll": "WÜRFELN",
"btn_roll_count": "WÜRFELN ({0})",
"btn_no_rolls_gui": "KEINE WÜRFE MEHR",
"your_scorecard": "Deine Wertungskarte",
"bonus_progress": "Bonus: {0} / 63",
"bonus_reached": "Bonus: +35 (Erreicht!)",
"total_score": "GESAMT: {0}",
"opponents_overview": "Gegner Übersicht",
"details_btn": "Details",
# --- Spielablauf & Controller ---
"err_title": "Fehler",
"err_profile_corrupt": "Profil manipuliert oder nicht gefunden!",
"err_name_exists": "Dieser Name existiert bereits.",
"game_over_title": "Spiel beendet",
"game_over_msg": "SPIEL BEENDET!\n\nRANGLISTE:\n",
"points_word": "Punkte",
"turn_label": "Runde {0}/13",
"bot_thinking": "{0} überlegt...",
"bot_scored_msg": "{0} hat {1} Punkte bei '{2}' eingetragen.",
# --- Dialoge & Pop-ups ---
"stats_title": "Statistiken",
"stats_popup_text": "GEGEN ECHTE GEGNER:\nSiege: {0} | Niederlagen: {1}\nHöchste Punkte: {2}\n\nGEGEN COMPUTER:\nSiege: {3} | Niederlagen: {4}\nHöchste Punkte: {5}",
"help_title": "Hilfe & Shortcuts",
"help_header": "Spiel-Hilfe & Shortcuts",
"help_text": "• Leertaste: Würfeln\n• Tasten 1-5: Würfel halten / freigeben\n• Oberer Teil (1-6): Erreiche 63+ Punkte für +35 Bonus!\n• Yahtzee: 5 gleiche Würfel (+50 Punkte / Joker)\n• Klicke auf 'Details' bei Gegnern, um deren Karte zu sehen.",
"close_btn": "Schließen",
"leave_title": "Zum Hauptmenü",
"leave_header": "Spielstand verlassen",
"leave_msg": "Möchtest du den aktuellen Fortschritt\nvorher speichern oder verwerfen?",
"save_btn": "Speichern",
"discard_btn": "Verwerfen",
"cancel_btn": "Abbrechen",
"achieved_fallback": "ERREICHT!",
"bot_details_title": "Details: {0}",
"bot_scorecard_header": "Wertungskarte: {0}",
"zero_confirm_title": "0 Punkte bestätigen",
"zero_confirm_header": "Kategorie streichen?",
"zero_confirm_msg": "Möchtest du für '{0}' wirklich\n0 Punkte eintragen?",
"zero_confirm_yes": "Ja, 0 Punkte",
"better_opt_title": "Bessere Option verfügbar!",
"better_opt_header": "Bessere Option gefunden!",
"better_opt_msg": "Du möchtest '{0}' wählen,\naber du hast hierfür eine deutlich bessere Option:\n\n-> {1} ({2} Punkte)!",
"better_opt_anyway": "Trotzdem eintragen",
# --- Curses TUI Keys ---
"bots": "Gegner",
"title_bots": "ANZAHL DER GEGNER",
"title_diff": "SCHWIERIGKEIT GEGNER {0}",
"rolling": "{0} würfelt...",
"scored": "{0} trägt {1} Punkte bei {2} ein. [Taste drücken]",
"turn_human": "Runde {0}/13 - DEIN ZUG",
"turn_bot": "Runde {0}/13 - ZUG VON {1}",
"leaderboard": "RANGLISTE",
"held_row": "Gehalten: ",
"roll_row": "Würfel: ",
"btn_reroll": "[ Nochmal ({0}) ]",
"btn_no_rolls": "[ Keine Würfe ]",
"btn_score": "[ Eintragen ]",
2026-11-02 18:32:36 +00:00
"upper_sec": "OBERER TEIL",
2026-11-02 21:43:42 +00:00
"lower_sec": "UNTERER TEIL"
},
"EN": {
# --- Categories ---
"cat_1": "Ones", "1": "Ones", "Einser": "Ones",
"cat_2": "Twos", "2": "Twos", "Zweier": "Twos",
"cat_3": "Threes", "3": "Threes", "Dreier": "Threes",
"cat_4": "Fours", "4": "Fours", "Vierer": "Fours",
"cat_5": "Fives", "5": "Fives", "Fünfer": "Fives",
"cat_6": "Sixes", "6": "Sixes", "Sechser": "Sixes",
"cat_3k": "Three of a Kind", "cat_3K": "Three of a Kind", "3K": "Three of a Kind", "Dreierpasch": "Three of a Kind",
"cat_4k": "Four of a Kind", "cat_4K": "Four of a Kind", "4K": "Four of a Kind", "Viererpasch": "Four of a Kind",
"cat_fh": "Full House", "cat_FH": "Full House", "FH": "Full House", "Full House": "Full House",
"cat_ss": "Small Straight", "cat_SS": "Small Straight", "SS": "Small Straight", "Kleine Straße": "Small Straight",
"cat_ls": "Large Straight", "cat_LS": "Large Straight", "LS": "Large Straight", "Große Straße": "Large Straight",
"cat_y": "Yahtzee", "cat_Y": "Yahtzee", "Y": "Yahtzee", "Yahtzee": "Yahtzee",
"cat_ch": "Chance", "cat_CH": "Chance", "CH": "Chance", "Chance": "Chance",
# --- Main Menu & Login ---
"login_btn": "Login",
"new_profile_btn": "New Profile",
"soul_label": "Soul: {0}",
"menu_resume": "Resume Game",
"menu_play": "Play vs Computer",
"menu_lang": "Language / Sprache (EN)",
"menu_stats": "Statistics",
"menu_exit": "Exit",
# --- Game Setup & Bots ---
"setup_title": "Game Settings",
"opponent_label": "Opponent {0}:",
"none_bot": "None",
"bot_default_name": "Bot {0}",
"start_ritual_btn": "Begin the Ritual",
"back_btn": "Back",
"bot_level_0": "Level 0: Random",
"bot_level_1": "Level 1: Simple",
"bot_level_2": "Level 2: Solid",
"bot_level_3": "Level 3: Hard",
"bot_level_4": "Level 4: Expert",
"bot_level_5": "Level 5: Grandmaster",
# --- BoardView ---
"btn_save_quit": "Save & Quit",
"btn_menu": "Menu",
"btn_help": "Help",
"your_dice": "Your Dice",
"btn_roll": "ROLL",
"btn_roll_count": "ROLL ({0})",
"btn_no_rolls_gui": "NO ROLLS LEFT",
"your_scorecard": "Your Scorecard",
"bonus_progress": "Bonus: {0} / 63",
"bonus_reached": "Bonus: +35 (Reached!)",
"total_score": "TOTAL: {0}",
"opponents_overview": "Opponents Overview",
"details_btn": "Details",
# --- Game Flow & Controller ---
"err_title": "Error",
"err_profile_corrupt": "Profile tampered with or not found!",
"err_name_exists": "This name already exists.",
"game_over_title": "Game Over",
"game_over_msg": "GAME OVER!\n\nLEADERBOARD:\n",
"points_word": "Points",
"turn_label": "Round {0}/13",
"bot_thinking": "{0} is thinking...",
"bot_scored_msg": "{0} scored {1} points in '{2}'.",
# --- Dialogs & Pop-ups ---
"stats_title": "Statistics",
"stats_popup_text": "VS REAL PLAYERS:\nWins: {0} | Losses: {1}\nHighscore: {2}\n\nVS COMPUTER:\nWins: {3} | Losses: {4}\nHighscore: {5}",
"help_title": "Help & Shortcuts",
"help_header": "Game Help & Shortcuts",
"help_text": "• Spacebar: Roll dice\n• Keys 1-5: Hold / release dice\n• Upper Section (1-6): Reach 63+ points for +35 bonus!\n• Yahtzee: 5 of a kind (+50 points / Joker)\n• Click 'Details' on opponents to view their scorecard.",
"close_btn": "Close",
"leave_title": "Return to Main Menu",
"leave_header": "Leave Game",
"leave_msg": "Do you want to save or discard\nyour current progress?",
"save_btn": "Save",
"discard_btn": "Discard",
"cancel_btn": "Cancel",
"achieved_fallback": "ACHIEVED!",
"bot_details_title": "Details: {0}",
"bot_scorecard_header": "Scorecard: {0}",
"zero_confirm_title": "Confirm 0 Points",
"zero_confirm_header": "Scratch Category?",
"zero_confirm_msg": "Are you sure you want to enter\n0 points for '{0}'?",
"zero_confirm_yes": "Yes, 0 Points",
"better_opt_title": "Better Option Available!",
"better_opt_header": "Better Option Found!",
"better_opt_msg": "You selected '{0}',\nbut there is a much better option available:\n\n-> {1} ({2} Points)!",
"better_opt_anyway": "Score Anyway",
# --- Curses TUI Keys ---
"bots": "Opponents",
"title_bots": "NUMBER OF OPPONENTS",
"title_diff": "OPPONENT {0} DIFFICULTY",
"rolling": "{0} is rolling...",
"scored": "{0} scored {1} pts in {2}. [Press any key]",
"turn_human": "Round {0}/13 - YOUR TURN",
"turn_bot": "Round {0}/13 - {1}'S TURN",
"leaderboard": "LEADERBOARD",
"held_row": "Held: ",
"roll_row": "Rolling: ",
"btn_reroll": "[ Reroll ({0}) ]",
"btn_no_rolls": "[ No Rolls ]",
"btn_score": "[ Score ]",
"upper_sec": "UPPER SECTION",
"lower_sec": "LOWER SECTION"
2026-11-02 18:32:36 +00:00
}
}
def t(key, *args):
2026-11-02 21:43:42 +00:00
lang_dict = TEXTS.get(CURRENT_LANG, TEXTS["DE"])
val = lang_dict.get(key, key)
if args:
try:
return val.format(*args)
except Exception:
return val
return val
2026-11-02 18:32:36 +00:00
def toggle_language():
global CURRENT_LANG
2026-11-02 21:43:42 +00:00
CURRENT_LANG = "EN" if CURRENT_LANG == "DE" else "DE"
return CURRENT_LANG