[wesnoth-commits] [wesnoth/wesnoth] 9e216c: Error handling for corrupt .mo files (#6215)
Steve Cotton
noreply at github.com
Thu Oct 21 18:27:18 UTC 2021
Branch: refs/heads/master
Home: https://github.com/wesnoth/wesnoth
Commit: 9e216c7ea82b0a25bd62897fc7c9b480cc685a46
https://github.com/wesnoth/wesnoth/commit/9e216c7ea82b0a25bd62897fc7c9b480cc685a46
Author: Steve Cotton <steve at octalot.co.uk>
Date: 2021-10-21 (Thu, 21 Oct 2021)
Changed paths:
M changelog.md
M src/gettext.cpp
Log Message:
-----------
Error handling for corrupt .mo files (#6215)
Previously, a corrupt .mo file caused the game to exit immediately. This meant
that a broken add-on could stop the user from reaching the main menu, a
situation that could only be recovered by editing the preferences file or by
deleting the add-on with a file browser.
The engine generates the locale 3 times:
* once with no .mo files loaded
* once with only the mainline .mo files loaded
* once with all .mo files loaded
This means that:
* starting Wesnoth with a corrupt .mo file in mainline will make the engine run
showing en_US text
* changing language with a corrupt .mo file in mainline will make the engine
stay in whatever language it had successfully loaded
* a corrupt .mo file in an add-on will disable .mo files in all add-ons, but
leave mainline translations active, and will let the user play the game
More information about the Commits
mailing list