Skip to main content

Texts & Language

TriviaFlow is fully internationalized. Whether you want to translate the game into a new language or just rename "Game Master" to "Quiz Wizard," you can do so without touching the core code.

1. Changing the Language​

The basic language is defined in your .env file.

# Options: 'en' (English), 'de' (German)
UI_LANGUAGE=en

When you change this, TriviaFlow loads the corresponding file from triviaflow/quiz/texts/{LANG}.py.

2. Overriding Specific Texts​

Instead of editing the core language files (which would be overwritten by a git pull), TriviaFlow looks for a Custom Override File.

How to Create an Override​

  1. Navigate to triviaflow/quiz/texts/.
  2. Create a new file named custom_en.py (if your language is en) or custom_de.py (if de).
  3. Define a dictionary named TEXTS with only the keys you want to change.

Example: triviaflow/quiz/texts/custom_en.py

TEXTS = {
# Funnier Title
"PLAYER_LOGIN_TITLE": "Join the Party! 🎉",

# Custom Emojis
"ICON_TROPHY": "👑",

# Renaming Roles
"GM_LOGIN_TITLE": "Wizard Login"
}

The system will load the default English texts first, and then merge your custom texts over them.

Available Keys​

You can find all available keys in the source file triviaflow/quiz/texts/en.py. Common keys include:

  • Lobby: LOBBY_JOIN_TITLE, LOBBY_LEADERBOARD_TITLE
  • Player: PLAYER_BTN_JOIN, PLAYER_WAITING_MSG
  • Alerts: MSG_KICKED, MSG_GAME_RESET
Git Safety

The .gitignore file is configured to ignore custom_*.py files. This means your customizations are safe and won't be overwritten when you update TriviaFlow.