Make sure error messages displayed in the news bar are translated

even if the language is changed from the menu (i.e. while the
message is being shown). This will not happen for the message
currently scrolling, but the next time the message is displayed.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8718 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-05-26 12:54:49 +00:00
parent ce3098d33e
commit 56d95382b0
3 changed files with 16 additions and 4 deletions

View File

@ -112,7 +112,9 @@ void AddonsManager::initOnline(const XMLNode *xml)
m_addons_list.lock();
if(index>=0)
{
m_addons_list.getData()[index].copyInstallData(addon);
}
else
{
m_addons_list.getData().push_back(addon);

View File

@ -294,13 +294,23 @@ CURLcode NetworkHttp::init()
if(status==CURLE_OK)
return status;
else
{
// This message must be translated dynamically in the main menu.
// If it would be translated here, it wouldn't be translated
// if the language is changed in the menu!
error_message=
_("Can't download addons list, check terminal for details.");
N_("Can't download addons list, check terminal for details.");
}
// Now fall through to error handling.
}
else
{
// This message must be translated dynamically in the main menu.
// If it would be translated here, it wouldn't be translated
// if the language is changed in the menu!
error_message=
_("Can't download news file, check terminal for details.");
N_("Can't download news file, check terminal for details.");
}
// Abort requested by stk -> display no error message and return
if(status==CURLE_ABORTED_BY_CALLBACK)

View File

@ -171,7 +171,7 @@ const core::stringw NewsManager::getNextNewsMessage()
{
// Only display error message in case of a problem.
if(m_error_message.size()>0)
return m_error_message;
return _(m_error_message.c_str());
if(m_news.getData().size()==0)
return "";
@ -216,7 +216,7 @@ const core::stringw NewsManager::getNextNewsMessage()
m = m_news.getData()[m_current_news_message].getNews();
}
m_news.unlock();
return m;
return _(m.c_str());
} // getNextNewsMessage
// ----------------------------------------------------------------------------