From cb6a1a45afce8d584ec679fca34c313d7a9ce8d7 Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 29 Oct 2011 22:34:45 +0000 Subject: [PATCH] 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 --- data/CREDITS | Bin 12862 -> 10850 bytes src/states_screens/credits.cpp | 35 ++++++++++++++++++++++----------- src/utils/translation.cpp | 12 +++++++++++ src/utils/translation.hpp | 4 ++++ 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/data/CREDITS b/data/CREDITS index cc518736811f83957cd05a95a1260cb49798bb3a..988542d6f3b449f6e3f74814442ca1854c1f95ee 100644 GIT binary patch delta 115 zcmdm&@+f4(4!O-6)Kr*7xfpaA6c}6?^nj!@Lq07pU=KgaU%-1hl5ykYQ$kVZLBKK)mSr z0qx!S4ZXGrH@)(|sEJ80`w#lOYo7zyXmc`i_Fj8^ylbs@?ep&0o7$g$UH|c!^{iqY z>syQWz#7)|U9boCCC`QP^z9d8mlx5mqfxaz3wF;!`t+;mkz$&T&VExw|0dG^Jn3)a z6G=STumg|QAYNu~3rLQLTf^=l>lRO)^8x=o(Dae7AwOXqYzqBGrZ22FkO{x6H(0f8 zh+WGyJFEuiRP7)E*euEs#*&9=aL{mLPsB<%=^=TGyI}JG6fi*vw&-9wepX}s3Rxbu z>@Z&S)?PPkj}C#BT!-Gy5j9CdX}->T^t5`fpW`s2&2}ou~V}H4$nve39cl^ zNCoJ;iBH%yv8{NumRx^Nfq}k`cAv&K@RN67fiwq>BGz8CiZl$=T&sXx!}c>DB|NBG zDnd6wnDZld_y~7O@M1%MW+$d9=~pBpFiXgG3BK!Rs-xPabZRgx(xdE&4_r&oRRWj} z30e@~$Py7R*d_sUtW$)jQ(4h9{-Wy@cJEy~W+?6m#;nco1bf0++ht{7);ejb=Y;8<{>uW^X(l=)*Y0B<^U8$GpOH3h2u7Tny2AUWqRe~R>DiC7_iog*$2N~3W?I1SGU z4)@SHb}$WGSCLQootNv)+HD$t8~HT91G{T;XKkMcglzJg@hO07_RB~ecp;(9JqleJ zY2sdPb?<221WEbk?3qUzhauKP%_{*tUMT~1EBM*7zgay-K7=T`YUAuqx$ZtvUBtsP zuP-*(ic>0TUT(S8jk|-S>a(;B;ydVQt`@j-*IYj~L1gbyow`q71};4e*QS+DiL(K) zhP=11RXYE}(&nmr6HU~3Az9&xk#ek}LOfdoVf>otk~%`VZnw^~mHzfeS=D@)o5<$u z?&<66H%Ixr1^WpjeH%mtB}usSpYi+YOySn3)?0-i(hr51^!LKI>91F=rr%F|eNA>6 pDFx0yRFNoM+e!Z@e3#ZHm-&PqhKaO1@g^-!&W#jLUr(N1`WN<3S@{3} diff --git a/src/states_screens/credits.cpp b/src/states_screens/credits.cpp index ca0b6baab..b8af375ef 100644 --- a/src/states_screens/credits.cpp +++ b/src/states_screens/credits.cpp @@ -207,21 +207,34 @@ void CreditsScreen::loadedFromFile() return; } - std::vector translator = - StringUtils::split(_("translator-credits"), '\n'); - m_sections.push_back( new CreditsSection("Launchpad translations")); - for(unsigned int i = 1; i < translator.size(); i = i + 4) + + irr::core::stringw translators_credits = _("translator-credits"); + + if (translators_credits != L"translator-credits") { - line = stringw("Translations"); - CreditsEntry entry(line); - getCurrentSection()->addEntry( entry ); - - for(unsigned int j = 0; i + j < translator.size() && j < 4; j ++) + std::vector translator = + StringUtils::split(translators_credits, '\n'); + + m_sections.push_back( new CreditsSection("Translations")); + for(unsigned int i = 1; i < translator.size(); i = i + 4) { - getCurrentSection()->addSubEntry(translator[i + j]); + line = stringw(translations->getCurrentLanguageName().c_str()); + CreditsEntry entry(line); + getCurrentSection()->addEntry( entry ); + + 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 ); } - assert(m_sections.size() > 0); } // loadedFromFile diff --git a/src/utils/translation.cpp b/src/utils/translation.cpp index b0b6a4d4e..3fddb1998 100644 --- a/src/utils/translation.cpp +++ b/src/utils/translation.cpp @@ -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(); +} + diff --git a/src/utils/translation.hpp b/src/utils/translation.hpp index 7aae797cd..d3854397f 100644 --- a/src/utils/translation.hpp +++ b/src/utils/translation.hpp @@ -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* getLanguageList() const; + + std::string getCurrentLanguageName(); }; // Translations