mail[Wesnoth-commits] r20115 - /trunk/src/help.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on September 05, 2007 - 08:13:
Author: alink
Date: Wed Sep  5 08:12:39 2007
New Revision: 20115

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20115&view=rev
Log:
- use the "name" key of [race] as title of race sub-sections in help
- unit type without race (no race key or no related [race]) uses now the 
translatable _("race^Miscellaneous"), as suggested by Soliton
Any other suggestion must be done faster than our translators.

Modified:
    trunk/src/help.cpp

Modified: trunk/src/help.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/help.cpp?rev=20115&r1=20114&r2=20115&view=diff
==============================================================================
--- trunk/src/help.cpp (original)
+++ trunk/src/help.cpp Wed Sep  5 08:12:39 2007
@@ -1494,8 +1494,16 @@
                config section_cfg;
 
                section_cfg["id"] =  "race_" + *it;
-               //FIXME: Need to choose a "No race" expression and translate 
it
-               section_cfg["title"] = it->empty() ? "" : 
gettext(it->c_str());
+               
+               std::string title;
+               const race_map::const_iterator race_it = 
game_info->races.find(*it);
+               if (race_it != game_info->races.end()) {
+                       title = race_it->second.name();
+               } else {
+                       title = _ ("race^Miscellaneous");
+               }
+               section_cfg["title"] = title;
+
                section_cfg["generator"] = "units:" + *it;
 
                parse_config_internal(help_cfg, &section_cfg, race_section, 
level+1);




Related Messages


Powered by MHonArc, Updated Wed Sep 05 08:20:22 2007