Add translation help for select challenge dialog

This commit is contained in:
Benau 2019-06-16 00:58:09 +08:00
parent 44095088ee
commit a7b096ab9b
2 changed files with 14 additions and 3 deletions

View File

@ -7,7 +7,7 @@
<spacer height="3%" width="1"/> <spacer height="3%" width="1"/>
<ribbon id="difficulty" height="25%" width="80%" align="center"> <ribbon id="difficulty" height="25%" width="80%" align="center">
<icon-button id="novice" icon="gui/icons/difficulty_easy.png" <icon-button id="novice" icon="gui/icons/difficulty_easy.png"
width="128" height="128" I18N="Difficulty" text="Novice"/> width="128" height="128" I18N="Difficulty" text="Novice"/>
<icon-button id="intermediate" icon="gui/icons/difficulty_medium.png" <icon-button id="intermediate" icon="gui/icons/difficulty_medium.png"
width="128" height="128" I18N="Difficulty" text="Intermediate"/> width="128" height="128" I18N="Difficulty" text="Intermediate"/>

View File

@ -48,7 +48,6 @@ core::stringw getLabel(RaceManager::Difficulty difficulty, const ChallengeData*
if (c_data->isGrandPrix()) if (c_data->isGrandPrix())
{ {
// Doesn't work for RTL
description += _("Grand Prix"); description += _("Grand Prix");
description += L" - "; description += L" - ";
description += RaceManager::getNameOf(c_data->getMinorMode()); description += RaceManager::getNameOf(c_data->getMinorMode());
@ -56,22 +55,30 @@ core::stringw getLabel(RaceManager::Difficulty difficulty, const ChallengeData*
else else
{ {
if (c_data->getEnergy(RaceManager::DIFFICULTY_EASY) > 0) if (c_data->getEnergy(RaceManager::DIFFICULTY_EASY) > 0)
{
//I18N: In the Select challenge dialog
description += _("Nitro challenge"); description += _("Nitro challenge");
}
else if (c_data->isGhostReplay()) else if (c_data->isGhostReplay())
{
//I18N: In the Select challenge dialog
description += _("Ghost replay race"); description += _("Ghost replay race");
}
else else
description += RaceManager::getNameOf(c_data->getMinorMode()); description += RaceManager::getNameOf(c_data->getMinorMode());
description += L" - "; description += L" - ";
//I18N: In the Select challenge dialog
description += _("Laps: %i", c_data->getNumLaps()); description += _("Laps: %i", c_data->getNumLaps());
if (c_data->getReverse()) if (c_data->getReverse())
{ {
description += L" - "; description += L" - ";
//I18N: In the Select challenge dialog, tell user this challenge has reversed laps
description += _("Mode: Reverse"); description += _("Mode: Reverse");
} }
} // if !isGrandPrix } // if !isGrandPrix
//I18N: In the Select challenge dialog, type of this challenge
label = _("Type: %s", description); label = _("Type: %s", description);
if (c_data->getMaxPosition(difficulty) != -1) if (c_data->getMaxPosition(difficulty) != -1)
@ -79,22 +86,26 @@ core::stringw getLabel(RaceManager::Difficulty difficulty, const ChallengeData*
int r = c_data->getMaxPosition(difficulty); int r = c_data->getMaxPosition(difficulty);
if (c_data->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER) r--; if (c_data->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER) r--;
label += L"\n"; label += L"\n";
//I18N: In the Select challenge dialog
label += _("Required Rank: %i", r); label += _("Required Rank: %i", r);
} }
if (c_data->getTimeRequirement(difficulty) > 0) if (c_data->getTimeRequirement(difficulty) > 0)
{ {
label += L"\n"; label += L"\n";
//I18N: In the Select challenge dialog
label += _("Required Time: %i", label += _("Required Time: %i",
StringUtils::timeToString(c_data->getTimeRequirement(difficulty)).c_str()); StringUtils::timeToString(c_data->getTimeRequirement(difficulty)).c_str());
} }
if (c_data->getEnergy(difficulty) > 0) if (c_data->getEnergy(difficulty) > 0)
{ {
label += L"\n"; label += L"\n";
//I18N: In the Select challenge dialog
label += _("Required Nitro Points: %i", c_data->getEnergy(difficulty)); label += _("Required Nitro Points: %i", c_data->getEnergy(difficulty));
} }
if (!c_data->isGhostReplay()) if (!c_data->isGhostReplay())
{ {
label += L"\n"; label += L"\n";
//I18N: In the Select challenge dialog
label += _("Number of AI Karts: %i", c_data->getNumKarts(difficulty) - 1); label += _("Number of AI Karts: %i", c_data->getNumKarts(difficulty) - 1);
} }