game_menu takes optionLabels, a dictionary or a function giving what to
say for each of a game's own options, so a translated game no longer
hears its option names read out in English. A function is asked each
time, so labels follow a change of language. The option is still what
game_menu returns.
instructions() and credits() read files/instructions.<language>.txt and
files/credits.<language>.txt when there is one for the language being
spoken, falling back to the language without its region and then to
English, and read them as UTF-8. translated_file() and language_code()
do the same for a game's own files.
Shift+F12 in game_menu, instruction_menu and learn_sounds goes back to
English and says so in English. set_language_reset() lets a game switch
its own text and remember the choice at the same time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Everything the library speaks or shows itself is marked for
translation in a libstormgames domain, separate from any game's, so
one translation serves every game: the text box, the text window,
speech history, game_menu's own items, learn_sounds, instructions,
credits, donate and the high scores. Sentences built from pieces are
whole sentences with named placeholders now, such as
"{character} deleted".
set_language(code) chooses the language, so a game that lets players
pick one can make the library speak it too; with no call it follows
the system, and falls back to English. Translations go in
locales/<language>/LC_MESSAGES/libstormgames.po, and
tools/update-translations.sh extracts the text into
locales/libstormgames.pot and compiles them.
The text box now names symbols when moving over or deleting them, as
it already did when typing, and get_input's default prompt is
translated. Game.display_text no longer drops the first and last
lines when Space reads them all or T copies them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>