|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Compile-time UI string table for EN/FR localization. More...
#include <I18n.hpp>
Collaboration diagram for I18n:Public Types | |
| enum class | Language { EN , FR } |
| enum class | Key { HUD_FPS , HUD_MAP , HUD_TIME_UNIT , HUD_UPTIME_UNKNOWN , HUD_UPTIME_PREFIX , HUD_UPTIME_H , HUD_UPTIME_M , HUD_UPTIME_S , HUD_PORT , HUD_MACHINE , LABEL_TILE , LABEL_PLAYER , LABEL_EGG , TILE_EMPTY , TILE_HEADER , PLAYER_TEAM , PLAYER_LEVEL , PLAYER_INVENTORY_EMPTY , PLAYER_INVENTORY , EGG_TEAM , PANEL_PLAYER_LIST , PANEL_LVL , BTN_FOLLOW , BTN_STOP_FOLLOW , SPEED_LABEL , PLAYER_HEAD_LEVEL , WIN_GAME_OVER , WIN_TEAM_WON , WIN_DURATION , WIN_DURATION_UNKNOWN , WIN_TICKS , WIN_QUIT , RESOURCE_FOOD , RESOURCE_LINEMATE , RESOURCE_DERAUMERE , RESOURCE_SIBUR , RESOURCE_MENDIANE , RESOURCE_PHIRAS , RESOURCE_THYSTAME , _COUNT } |
Static Public Member Functions | |
| static void | setLanguage (Language lang) |
| static Language | getLanguage () |
| static const char * | get (Key key) |
| static const char * | resourceName (int index) |
| Resource name by index (0–6), matching Resources[] ordering. | |
Static Private Attributes | |
| static Language | _lang = I18n::Language::EN |
| static constexpr const char * | _strings [2][static_cast< int >(Key::_COUNT)] |
Compile-time UI string table for EN/FR localization.
Strings are stored as a static constexpr 2D array indexed by [language][key]. This gives O(1) lookup with zero allocation and no I/O — deliberately chosen over a config file, since languages are a compile-time concern and a missing file is an unnecessary failure mode.
To add a language: extend the Language enum and add a column to _strings. To add a string: add a Key entry and a corresponding value in each language column.
|
strong |
|
strong |
|
inlinestatic |
Definition at line 86 of file I18n.hpp.
References _lang, and _strings.
Referenced by EntityTooltipWidget::_positionButton(), EntityTooltipWidget::_rebuild(), WinScreen::_rebuildPanel(), RaylibRenderer::_render2D(), HudWidget::draw(), SpeedSlider::draw(), WinScreen::draw(), EntityTooltipWidget::handleInput(), PlayerPanel::handleInput(), and resourceName().
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 84 of file I18n.hpp.
References _lang.
Referenced by RaylibRenderer::handleInput().
Here is the caller graph for this function:
|
inlinestatic |
Resource name by index (0–6), matching Resources[] ordering.
Definition at line 92 of file I18n.hpp.
References get(), and RESOURCE_FOOD.
Referenced by EntityTooltipWidget::_rebuild().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 83 of file I18n.hpp.
References _lang.
Referenced by RaylibRenderer::handleInput(), and App::run().
Here is the caller graph for this function:
|
staticprivate |
Definition at line 98 of file I18n.hpp.
Referenced by get(), getLanguage(), and setLanguage().
|
staticconstexprprivate |