Fixed track names not being translated on live language switch

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7633 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-02-06 02:59:19 +00:00
parent a580f413e3
commit 896e2664fc
5 changed files with 12 additions and 11 deletions

View File

@ -571,7 +571,7 @@ int handleCmdLine(int argc, char **argv)
{
fprintf ( stdout, "\t%10s: %ls\n",
track->getIdent().c_str(),
track->getName().c_str());
track->getName());
}
}

View File

@ -128,7 +128,7 @@ void ArenasScreen::eventCallback(Widget* widget, const std::string& name, const
{
ITexture* screenshot = irr_driver->getTexture( clickedTrack->getScreenshotFile().c_str() );
new TrackInfoDialog(selection, clickedTrack->getIdent(), clickedTrack->getName().c_str(),
new TrackInfoDialog(selection, clickedTrack->getIdent(), clickedTrack->getName(),
screenshot, 0.8f, 0.7f);
}
@ -147,7 +147,7 @@ void ArenasScreen::eventCallback(Widget* widget, const std::string& name, const
{
ITexture* screenshot = irr_driver->getTexture( clickedTrack->getScreenshotFile().c_str() );
new TrackInfoDialog(selection, clickedTrack->getIdent(), clickedTrack->getName().c_str(),
new TrackInfoDialog(selection, clickedTrack->getIdent(), clickedTrack->getName(),
screenshot, 0.8f, 0.7f);
} // clickedTrack != NULL
} // if random_track

View File

@ -117,7 +117,7 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, const
ITexture* screenshot = irr_driver->getTexture( clickedTrack->getScreenshotFile().c_str() );
new TrackInfoDialog(selection, clickedTrack->getIdent(),
translations->fribidize(clickedTrack->getName().c_str()),
translations->fribidize(clickedTrack->getName()),
screenshot, 0.8f, 0.7f);
}
@ -137,7 +137,7 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, const
ITexture* screenshot = irr_driver->getTexture( clickedTrack->getScreenshotFile().c_str() );
new TrackInfoDialog(selection, clickedTrack->getIdent(),
translations->fribidize(clickedTrack->getName().c_str()),
translations->fribidize(clickedTrack->getName()),
screenshot, 0.8f, 0.7f);
}
}

View File

@ -196,9 +196,7 @@ void Track::loadTrackInfo()
o<<"Can't load track '"<<m_filename<<"', no track element.";
throw std::runtime_error(o.str());
}
std::string temp_name;
root->get("name", &temp_name);
m_name = _LTR(temp_name.c_str());
root->get("name", &m_name);
//root->get("description", &m_description);
root->get("designer", &m_designer);

View File

@ -147,7 +147,8 @@ private:
std::vector<TrackMode> m_all_modes;
/** Name of the track to display. */
irr::core::stringw m_name;
std::string m_name;
bool m_use_fog;
float m_fog_density;
float m_fog_start;
@ -207,8 +208,10 @@ public:
/** Returns a unique identifier for this track (the directory name). */
const std::string& getIdent () const {return m_ident; }
/** Returns the name of the track, which is e.g. displayed on the screen. */
const irr::core::stringw& getName () const {return m_name; }
/** Returns the name of the track, which is e.g. displayed on the screen.
\note this is the LTR name, invoke fribidi as needed
*/
const wchar_t* getName () const {return translations->w_gettext(m_name.c_str()); }
/** Returns all groups this track belongs to. */
const std::vector<std::string>