On Wed, Jun 01, 2005 at 09:01:36PM +0200, Yann Dirson wrote: > We could start by only setting a flag on a global basis, possibly in a > new game.cfg section, and append " (incomplete)" to the relevant > translations. That would be quite easy to do, and has only a small > potential for disruption. That may be true also for a simple warning > dialog to be displayed both when a language has been selected, and at > startup.
This is a preliminary patch for review. It features no dialog yet. It adds an "incomplete_translations" list field in the game_config, and appends " [incomplete]" to the displayed language name. I also tried a modification of the languagedef_lessthan_p(), which looked like a simple way to sort all incomplete ones down the list, but it is unfortunately currently not used. Any simple idea to get around this ? (I was thinking about something like renaming this func to operator< and calling std::sort). Should we even try at this point in the freeze ? Best regards, -- Yann Dirson <[EMAIL PROTECTED]> | Debian-related: <[EMAIL PROTECTED]> | Support Debian GNU/Linux: | Freedom, Power, Stability, Gratis http://ydirson.free.fr/ | Check <http://www.debian.org/> Index: data/game.cfg =================================================================== RCS file: /cvsroot/wesnoth/wesnoth/data/game.cfg,v retrieving revision 1.161 diff -u -r1.161 game.cfg --- data/game.cfg 1 Jun 2005 09:42:14 -0000 1.161 +++ data/game.cfg 1 Jun 2005 23:08:41 -0000 @@ -93,7 +93,8 @@ observer_image=misc/eye.png download_campaign_image="" - + + incomplete_translations=bg_BG,et_EE [/game_config] [textdomain] Index: src/game_config.cpp =================================================================== RCS file: /cvsroot/wesnoth/wesnoth/src/game_config.cpp,v retrieving revision 1.98 diff -u -r1.98 game_config.cpp --- src/game_config.cpp 16 May 2005 22:44:19 -0000 1.98 +++ src/game_config.cpp 1 Jun 2005 23:08:41 -0000 @@ -59,6 +59,8 @@ std::vector<std::string> foot_left_nw, foot_left_n, foot_right_nw, foot_right_n; + std::vector<std::string> incomplete_translations; + std::string observer_image; std::string unchecked_menu_image = "buttons/checkbox.png"; @@ -140,5 +142,7 @@ observer_image = v["observer_image"]; download_campaign_image = v["download_campaign_image"]; + + incomplete_translations = utils::split(v["incomplete_translations"]); } } Index: src/game_config.hpp =================================================================== RCS file: /cvsroot/wesnoth/wesnoth/src/game_config.hpp,v retrieving revision 1.29 diff -u -r1.29 game_config.hpp --- src/game_config.hpp 16 May 2005 22:44:19 -0000 1.29 +++ src/game_config.hpp 1 Jun 2005 23:08:41 -0000 @@ -46,6 +46,8 @@ extern std::vector<std::string> foot_left_nw,foot_left_n,foot_right_nw,foot_right_n; + extern std::vector<std::string> incomplete_translations; + extern int title_logo_x, title_logo_y, title_buttons_x, title_buttons_y, title_buttons_padding, title_tip_x, title_tip_y, title_tip_width, title_tip_padding; namespace sounds { Index: src/language.cpp =================================================================== RCS file: /cvsroot/wesnoth/wesnoth/src/language.cpp,v retrieving revision 1.89 diff -u -r1.89 language.cpp --- src/language.cpp 16 May 2005 22:44:19 -0000 1.89 +++ src/language.cpp 1 Jun 2005 23:08:42 -0000 @@ -74,12 +74,29 @@ std::string languagedef_name (const language_def& def) { - return def.language; + if (std::find(game_config::incomplete_translations.begin(), + game_config::incomplete_translations.end(), + def.localename) == game_config::incomplete_translations.end()) + return def.language; + else + return (def.language + " [incomplete]"); } bool languagedef_lessthan_p (const language_def& def1, const language_def& def2) { - return (def1.language < def2.language); + bool incomplete1 = (std::find(game_config::incomplete_translations.begin(), + game_config::incomplete_translations.end(), + def1.localename) == game_config::incomplete_translations.end()); + bool incomplete2 = (std::find(game_config::incomplete_translations.begin(), + game_config::incomplete_translations.end(), + def2.localename) == game_config::incomplete_translations.end()); + + if (!(incomplete1 ^ incomplete2)) + return (def1.language < def2.language); + else if (incomplete1) + return false; + else + return true; } bool language_def::operator== (const language_def& a)