Fixed translator credits display (translators were repeated before).

Added #undef'ed debug mode to only see translations.
This commit is contained in:
hiker 2015-03-31 16:16:30 +11:00
parent cd67daf4a3
commit c7e785b59c

View File

@ -170,6 +170,13 @@ void CreditsScreen::loadedFromFile()
// let's assume the file is encoded as UTF-16 // let's assume the file is encoded as UTF-16
while (getWideLine( file, &line )) while (getWideLine( file, &line ))
{ {
#undef DEBUG_TRANSLATIONS // Enable to only see the translator credits
#ifdef DEBUG_TRANSLATIONS
static int my_counter = 0;
if (my_counter > 0)
break;
my_counter++;
#endif
stringc cversion = line.c_str(); stringc cversion = line.c_str();
//printf("CREDITS line : %s\n", cversion.c_str()); //printf("CREDITS line : %s\n", cversion.c_str());
@ -207,6 +214,7 @@ void CreditsScreen::loadedFromFile()
irr::core::stringw translators_credits = _("translator-credits"); irr::core::stringw translators_credits = _("translator-credits");
const int MAX_PER_SCREEN = 6;
if (translators_credits != L"translator-credits") if (translators_credits != L"translator-credits")
{ {
@ -214,13 +222,13 @@ void CreditsScreen::loadedFromFile()
StringUtils::split(translators_credits, '\n'); StringUtils::split(translators_credits, '\n');
m_sections.push_back( new CreditsSection("Translations")); m_sections.push_back( new CreditsSection("Translations"));
for(unsigned int i = 1; i < translator.size(); i = i + 4) for(unsigned int i = 1; i < translator.size(); i = i + MAX_PER_SCREEN)
{ {
line = stringw(translations->getCurrentLanguageName().c_str()); line = stringw(translations->getCurrentLanguageName().c_str());
CreditsEntry entry(line); CreditsEntry entry(line);
getCurrentSection()->addEntry( entry ); getCurrentSection()->addEntry( entry );
for(unsigned int j = 0; i + j < translator.size() && j < 6; j ++) for(unsigned int j = 0; i + j < translator.size() && j < MAX_PER_SCREEN; j ++)
{ {
getCurrentSection()->addSubEntry(translator[i + j]); getCurrentSection()->addSubEntry(translator[i + j]);
} }