Fix capitalization of categories, fixes #4622 (#4832)

- Fix capitalization of "Standard" in kart and track selection screens
 - Fix both "All" and "Standard" in random GP screen
 - Code style/documentation/consistency improvements
This commit is contained in:
QwertyChouskie 2022-12-27 09:27:55 -08:00 committed by GitHub
parent ebaf521269
commit 3bad8d943a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 81 additions and 34 deletions

View File

@ -61,7 +61,7 @@ private:
* than once. */
std::vector<int> m_selected_karts;
/** Contains a flag for each kart indicating wether it is available on
/** Contains a flag for each kart indicating whether it is available on
* all clients or not. */
std::vector<bool> m_kart_available;

View File

@ -76,17 +76,21 @@ void ArenasScreen::beforeAddingWidget()
// Make group names being picked up by gettext
#define FOR_GETTEXT_ONLY(x)
//I18N: arena group name
FOR_GETTEXT_ONLY( _("standard") )
//I18N: arena group name
//I18N: track group name
FOR_GETTEXT_ONLY( _("All") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Standard") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Add-Ons") )
// add others after
// Add other groups after
for (int n=0; n<group_amount; n++)
{
// try to translate the group name
if (groups[n] == "standard") // Fix capitalization (#4622)
tabs->addTextChild( _("Standard") , groups[n]);
else // Try to translate group names
tabs->addTextChild( _(groups[n].c_str()) , groups[n]);
}
} // for n<group_amount
int num_of_arenas=0;
for (unsigned int n=0; n<track_manager->getNumberOfTracks(); n++) //iterate through tracks to find how many are arenas

View File

@ -140,16 +140,20 @@ void EasterEggScreen::beforeAddingWidget()
// Make group names being picked up by gettext
#define FOR_GETTEXT_ONLY(x)
//I18N: track group name
FOR_GETTEXT_ONLY( _("standard") )
FOR_GETTEXT_ONLY( _("All") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Standard") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Add-Ons") )
// add others after
// Add other groups after
for (int n=0; n<group_amount; n++)
{
// try to translate the group name
if (groups[n] == "standard") // Fix capitalization (#4622)
tabs->addTextChild( _("Standard") , groups[n]);
else // Try to translate group names
tabs->addTextChild( _(groups[n].c_str()) , groups[n]);
}
} // for n<group_amount
int num_of_arenas=0;
for (unsigned int n=0; n<track_manager->getNumberOfTracks(); n++) //iterate through tracks to find how many are arenas

View File

@ -234,17 +234,33 @@ void GPInfoScreen::init()
// been added or deleted since the last time this screen was shown.
const std::vector<std::string>& groups = track_manager->getAllTrackGroups();
m_group_names.clear();
m_group_names.push_back("all");
for (unsigned int i = 0; i < groups.size(); i++)
m_group_names.push_back("all"); // Add "all" group as first group
for (unsigned int i = 0; i < groups.size(); i++) // Add rest of groups
m_group_names.push_back(groups[i]);
m_group_spinner->clearLabels();
int index_standard=0;
int index_standard = 0; // Index value of "standard" category
for (unsigned int i = 0; i < m_group_names.size(); i++)
{
m_group_spinner->addLabel(_(m_group_names[i].c_str()));
if (m_group_names[i] == "standard")
index_standard = i + 1;
if (m_group_names[i] == "all")
{
// Fix capitalization (#4622)
m_group_spinner->addLabel( _("All") );
}
else if (m_group_names[i] == "standard")
{
// Set index value of "Standard" category
index_standard = i + 1;
// Fix capitalization (#4622)
m_group_spinner->addLabel( _("Standard") );
}
else
{
m_group_spinner->addLabel(_(m_group_names[i].c_str()));
}
}
// Try to keep a previously selected group value
if (m_group_spinner->getValue() >= (int)groups.size())
{

View File

@ -308,25 +308,29 @@ void KartSelectionScreen::beforeAddingWidget()
kart_properties_manager->getAllGroups();
const int group_amount = (int)groups.size();
// add all group first
// Add "All" group first
if (group_amount > 1)
{
//I18N: name of the tab that will show tracks from all groups
//I18N: name of the tab that will show karts from all groups
tabs->addTextChild( _("All") , ALL_KART_GROUPS_ID);
}
// Make group names being picked up by gettext
#define FOR_GETTEXT_ONLY(x)
//I18N: kart group name
FOR_GETTEXT_ONLY( _("standard") )
FOR_GETTEXT_ONLY( _("All") )
//I18N: kart group name
FOR_GETTEXT_ONLY( _("Standard") )
//I18N: kart group name
FOR_GETTEXT_ONLY( _("Add-Ons") )
// add others after
// Add other groups after
for (int n=0; n<group_amount; n++)
{
// try to translate group names
if (groups[n] == "standard") // Fix capitalization (#4622)
tabs->addTextChild( _("Standard") , groups[n]);
else // Try to translate group names
tabs->addTextChild( _(groups[n].c_str()) , groups[n]);
} // for n<group_amount

View File

@ -355,9 +355,23 @@ void TracksScreen::beforeAddingWidget()
tabs->addTextChild( _("All"), ALL_TRACK_GROUPS_ID );
}
// add behind the other categories
// Make group names being picked up by gettext
#define FOR_GETTEXT_ONLY(x)
//I18N: track group name
FOR_GETTEXT_ONLY( _("All") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Standard") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Add-Ons") )
// Add other groups after
for (int n=0; n<group_amount; n++)
{
if (groups[n] == "standard") // Fix capitalization (#4622)
tabs->addTextChild( _("Standard") , groups[n]);
else // Try to translate group names
tabs->addTextChild( _(groups[n].c_str()) , groups[n]);
} // for n<group_amount
DynamicRibbonWidget* tracks_widget = getWidget<DynamicRibbonWidget>("tracks");
tracks_widget->setItemCountHint( (int)track_manager->getNumberOfTracks()+1 );

View File

@ -154,15 +154,20 @@ void TracksAndGPScreen::beforeAddingWidget()
// Make group names being picked up by gettext
#define FOR_GETTEXT_ONLY(x)
//I18N: track group name
FOR_GETTEXT_ONLY( _("all") )
FOR_GETTEXT_ONLY( _("All") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("standard") )
FOR_GETTEXT_ONLY( _("Standard") )
//I18N: track group name
FOR_GETTEXT_ONLY( _("Add-Ons") )
// add behind the other categories
// Add other groups after
for (int n=0; n<group_amount; n++)
{
if (groups[n] == "standard") // Fix capitalization (#4622)
tabs->addTextChild( _("Standard") , groups[n]);
else // Try to translate group names
tabs->addTextChild( _(groups[n].c_str()) , groups[n]);
} // for n<group_amount
DynamicRibbonWidget* tracks_widget = getWidget<DynamicRibbonWidget>("tracks");
tracks_widget->setItemCountHint( (int)track_manager->getNumberOfTracks()+1 );