Tweaks to credits : remove outdated translators section from the CREDIT file, use the credits that Launchpad puts in the .po file instead

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10062 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-10-29 22:34:45 +00:00
parent b262a63d24
commit cb6a1a45af
4 changed files with 40 additions and 11 deletions

Binary file not shown.

View File

@ -207,22 +207,35 @@ void CreditsScreen::loadedFromFile()
return;
}
irr::core::stringw translators_credits = _("translator-credits");
if (translators_credits != L"translator-credits")
{
std::vector<irr::core::stringw> translator =
StringUtils::split(_("translator-credits"), '\n');
m_sections.push_back( new CreditsSection("Launchpad translations"));
StringUtils::split(translators_credits, '\n');
m_sections.push_back( new CreditsSection("Translations"));
for(unsigned int i = 1; i < translator.size(); i = i + 4)
{
line = stringw("Translations");
line = stringw(translations->getCurrentLanguageName().c_str());
CreditsEntry entry(line);
getCurrentSection()->addEntry( entry );
for(unsigned int j = 0; i + j < translator.size() && j < 4; j ++)
for(unsigned int j = 0; i + j < translator.size() && j < 6; j ++)
{
getCurrentSection()->addSubEntry(translator[i + j]);
}
}
assert(m_sections.size() > 0);
// FIXME for testing only
m_sections.swap( m_sections.size() - 1, 0 );
// translations should be just before the last screen
//m_sections.swap( m_sections.size() - 1, m_sections.size() - 2 );
}
} // loadedFromFile
// ----------------------------------------------------------------------------

View File

@ -223,6 +223,8 @@ Translations::Translations() //: m_dictionary_manager("UTF-16")
}
}
m_current_language_name = l.get_name();
if (!l)
{
m_dictionary = m_dictionary_manager.get_dictionary();
@ -233,12 +235,16 @@ Translations::Translations() //: m_dictionary_manager("UTF-16")
std::cout << "[translate] Env var LANGUAGE = '" << language
<< "', which corresponds to '"
<< Language::from_env(language).get_name() << "'\n";
m_current_language_name = Language::from_env(language).get_name() ;
m_dictionary = m_dictionary_manager.get_dictionary(
Language::from_env(language) );
}
}
else
{
m_current_language_name = "Default language";
m_dictionary = m_dictionary_manager.get_dictionary();
}
@ -404,3 +410,9 @@ bool Translations::isRTLLanguage() const
return m_rtl;
}
std::string Translations::getCurrentLanguageName()
{
return m_current_language_name;
//return m_dictionary_manager.get_language().get_name();
}

View File

@ -46,6 +46,8 @@ private:
irr::core::stringw m_converted_string;
bool m_rtl;
std::string m_current_language_name;
public:
Translations();
@ -57,6 +59,8 @@ public:
const wchar_t* fribidize(const irr::core::stringw &str) { return fribidize(str.c_str()); }
const std::vector<std::string>* getLanguageList() const;
std::string getCurrentLanguageName();
}; // Translations