← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands

 

Review: Approve

couple of nits to consider.

Diff comments:

> === modified file 'src/ui_fsmenu/campaign_select.cc'
> --- src/ui_fsmenu/campaign_select.cc	2014-10-31 07:40:54 +0000
> +++ src/ui_fsmenu/campaign_select.cc	2014-12-07 10:33:42 +0000
> @@ -233,11 +233,14 @@
>  			CampaignListData campaign_data;
>  
>  			campaign_data.index = i;
> -			campaign_data.name = s.get_string(cname.c_str(), "");
> -			campaign_data.tribename = s.get_string(ctribename.c_str(), "");
> +
> +			i18n::Textdomain td("maps");

Open a new scope to destroy 'td' as early as possible again? You do it below.

> +			campaign_data.name = _(s.get_string(cname.c_str(), ""));
> +			campaign_data.tribename = _(s.get_string(ctribename.c_str(), ""));
>  			campaign_data.difficulty = difficulty;
> -			campaign_data.difficulty_description = s.get_string(cdiff_descr.c_str(), "");
> -			campaign_data.description = s.get_string(cdescription.c_str(), "");
> +			campaign_data.difficulty_description = _(s.get_string(cdiff_descr.c_str(), ""));
> +			campaign_data.description = _(s.get_string(cdescription.c_str(), ""));
> +
>  			m_campaigns_data.push_back(campaign_data);
>  
>  			UI::Table<uintptr_t>::EntryRecord& tableEntry = m_table.add(i);
> @@ -464,15 +467,17 @@
>  		Section & global_s = prof->get_safe_section("global");
>  
>  		// Set subtitle of the page
> -		const std::string campaign_name = (boost::format("campname%u") % campaign).str();
> -		const std::string campaign_tribe = (boost::format("camptribe%u") % campaign).str();
> -		m_subtitle.set_text((boost::format("%s — %s")
> -									% global_s.get_string(campaign_tribe.c_str())
> -									% global_s.get_string(campaign_name.c_str())).str());
> +		const char* campaign_tribe = _(global_s.get_string(
> +													 (boost::format("camptribe%u") % campaign).str().c_str()));
> +		const char* campaign_name;
> +		{
> +			i18n::Textdomain td("maps");
> +			campaign_name = _(global_s.get_string((boost::format("campname%u") % campaign).str().c_str()));
> +		}
> +		m_subtitle.set_text((boost::format("%s — %s") % campaign_tribe % campaign_name).str());
>  
>  		// Get section of campaign-maps
> -		const std::string campaign_section = (boost::format("campsect%u") % campaign).str();
> -		campsection = global_s.get_string(campaign_section.c_str());
> +		campsection = global_s.get_string((boost::format("campsect%u") % campaign).str().c_str());
>  	}
>  
>  	// Create the entry we use to load the section of the map
> 
> === modified file 'src/ui_fsmenu/launch_mpg.cc'
> --- src/ui_fsmenu/launch_mpg.cc	2014-10-28 08:16:53 +0000
> +++ src/ui_fsmenu/launch_mpg.cc	2014-12-07 10:33:42 +0000
> @@ -491,14 +491,11 @@
>  		}
>  	} else {
>  		// Write client infos
> -		std::string temp =
> -			(settings.playernum > -1) && (settings.playernum < MAX_PLAYERS)
> -			?
> -			(boost::format(_("Player %i")) % (settings.playernum + 1)).str()
> -			:
> -			_("Spectator");
> -		temp  = (boost::format(_("At the moment you are %s")) % temp.c_str()).str();
> -		m_client_info.set_text(temp);
> +		std::string client_info =
> +			(settings.playernum >= 0) && (settings.playernum < MAX_PLAYERS) ?
> +					(boost::format(_("You are Player %i.")) % (settings.playernum + 1)).str() :
> +					_("You are a spectator.");
> +		m_client_info.set_text(client_info);
>  	}
>  
>  	m_ok.set_enabled(m_settings->can_launch());
> 
> === modified file 'utils/buildcat.py'
> --- utils/buildcat.py	2014-09-29 18:52:21 +0000
> +++ utils/buildcat.py	2014-12-07 10:33:42 +0000
> @@ -27,7 +27,7 @@
>      ( "maps/maps", [
>          "../../maps/*/elemental",
>          "../../maps/*/*/elemental",
> -        "../../campaigns/cconfig",
> +        "../../campaigns/*.conf",
>          "../../campaigns/*/elemental"
>      ] ),
>      ( "texts/texts", ["../../txts/license",
> 


-- 
https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/243907
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/string-fixes.


References