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
- Navigate to
triviaflow/quiz/texts/. - Create a new file named
custom_en.py(if your language isen) orcustom_de.py(ifde). - Define a dictionary named
TEXTSwith 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
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.