kaetemi 4 years ago
parent 1963bdedcc
commit 051c46b95a

@ -99,7 +99,7 @@ public:
/// Return a vector with all language available. The vector contains the name of the language. /// Return a vector with all language available. The vector contains the name of the language.
/// The index in the vector is used in \c load() function /// The index in the vector is used in \c load() function
static const std::vector<ucstring> &getLanguageNames(); static const std::vector<std::string> &getLanguageNames();
/** Return a vector with all language code available. /** Return a vector with all language code available.
* Code are ISO 639-2 compliant. * Code are ISO 639-2 compliant.
@ -122,7 +122,7 @@ public:
static void loadFromFilename (const std::string &filename, bool reload); static void loadFromFilename (const std::string &filename, bool reload);
/// Returns the name of the language in the language name (English, Francais, ...) /// Returns the name of the language in the language name (English, Francais, ...)
static ucstring getCurrentLanguageName (); static std::string getCurrentLanguageName ();
/// Returns the code of the language ("fr", "en", ...) /// Returns the code of the language ("fr", "en", ...)
static std::string getCurrentLanguageCode (); static std::string getCurrentLanguageCode ();
@ -134,7 +134,10 @@ public:
static bool setSystemLanguageCode (const std::string &languageCode); static bool setSystemLanguageCode (const std::string &languageCode);
/// Find a string in the selected language and return his association. /// Find a string in the selected language and return his association.
static const ucstring &get (const std::string &label); static const ucstring &getAsUtf16 (const std::string &label);
/// Find a string in the selected language and return his association.
static const std::string &get (const std::string &label);
// Test if a string has a translation in the selected language. // Test if a string has a translation in the selected language.
// NB : The empty string is considered to have a translation // NB : The empty string is considered to have a translation
@ -219,24 +222,28 @@ public:
private: private:
typedef std::map<std::string, ucstring> StrMapContainer; typedef std::map<std::string, std::string> StrMapContainer;
typedef std::map<std::string, ucstring> StrMapContainer16;
static ILoadProxy *_LoadProxy; static ILoadProxy *_LoadProxy;
static StrMapContainer _StrMap; static StrMapContainer _StrMap;
static StrMapContainer16 _StrMap16;
static bool _StrMapLoaded; static bool _StrMapLoaded;
// the alternative language that will be used if the sentence is not found in the original language // the alternative language that will be used if the sentence is not found in the original language
static StrMapContainer _StrMapFallback; static StrMapContainer _StrMapFallback;
static StrMapContainer16 _StrMapFallback16;
static std::vector<std::string> _LanguageCodes; static std::vector<std::string> _LanguageCodes;
static std::vector<ucstring> _LanguageNames; static std::vector<std::string> _LanguageNames;
static std::string _SystemLanguageCode; static std::string _SystemLanguageCode;
static bool _LanguagesNamesLoaded; static bool _LanguagesNamesLoaded;
static std::string _SelectedLanguageCode; static std::string _SelectedLanguageCode;
static const ucstring _NotTranslatedValue; static const ucstring _NotTranslatedValue16;
static const std::string _NotTranslatedValue;
/** Structure to hold contextual info during /** Structure to hold contextual info during
* read of preprocessed file * read of preprocessed file
@ -256,7 +263,7 @@ private:
/// Init _LanguageCodes and _LanguageNames /// Init _LanguageCodes and _LanguageNames
static void initLanguages(); static void initLanguages();
static bool loadFileIntoMap(const std::string &filename, StrMapContainer &dest); static bool loadFileIntoMap(const std::string &filename, StrMapContainer &dest, StrMapContainer16 &dest16);
/// The internal read function, it does the real job of readTextFile /// The internal read function, it does the real job of readTextFile
static void _readTextFile(const std::string &filename, static void _readTextFile(const std::string &filename,

@ -127,7 +127,7 @@ namespace NLGUI
{ {
// Force I18N tooltip // Force I18N tooltip
if (!editorMode) if (!editorMode)
_ContextHelp = CI18N::get((const char *)prop).toUtf8(); _ContextHelp = CI18N::get((const char *)prop);
else else
_ContextHelp = (const char *)prop; _ContextHelp = (const char *)prop;
} }
@ -138,7 +138,7 @@ namespace NLGUI
if (prop) if (prop)
{ {
if (!editorMode && NLMISC::startsWith((const char *)prop, "ui")) if (!editorMode && NLMISC::startsWith((const char *)prop, "ui"))
_ContextHelp = CI18N::get((const char *)prop).toUtf8(); _ContextHelp = CI18N::get((const char *)prop);
else else
_ContextHelp = (const char *)prop; _ContextHelp = (const char *)prop;
} }
@ -259,7 +259,7 @@ namespace NLGUI
if( name == "tooltip" ) if( name == "tooltip" )
{ {
if (!editorMode && NLMISC::startsWith(value, "ui")) if (!editorMode && NLMISC::startsWith(value, "ui"))
_ContextHelp = CI18N::get(value).toUtf8(); _ContextHelp = CI18N::get(value);
else else
_ContextHelp = value; _ContextHelp = value;
return; return;
@ -268,7 +268,7 @@ namespace NLGUI
if( name == "tooltip_i18n" ) if( name == "tooltip_i18n" )
{ {
if (!editorMode) if (!editorMode)
_ContextHelp = CI18N::get(value).toUtf8(); _ContextHelp = CI18N::get(value);
else else
_ContextHelp = value; _ContextHelp = value;
return; return;

@ -598,7 +598,7 @@ namespace NLGUI
const char *propPtr = prop; const char *propPtr = prop;
std::string text; std::string text;
if (NLMISC::startsWith(propPtr, "ui")) if (NLMISC::startsWith(propPtr, "ui"))
text = CI18N::get(propPtr).toUtf8(); text = CI18N::get(propPtr);
else else
text = propPtr; text = propPtr;
_ViewText->setText(text); _ViewText->setText(text);

@ -184,7 +184,7 @@ namespace NLGUI
{ {
const char *propPtr = name; const char *propPtr = name;
if (NLMISC::startsWith(propPtr, "ui")) if (NLMISC::startsWith(propPtr, "ui"))
addText(CI18N::get(propPtr).toUtf8()); addText(CI18N::get(propPtr));
else else
addText(propPtr); addText(propPtr);
} }

@ -148,7 +148,7 @@ namespace NLGUI
{ {
const char *propPtr = ptr; const char *propPtr = ptr;
if (NLMISC::startsWith(propPtr, "ui")) if (NLMISC::startsWith(propPtr, "ui"))
_EmptyText = CI18N::get(propPtr).toUtf8(); _EmptyText = CI18N::get(propPtr);
else else
_EmptyText = propPtr; _EmptyText = propPtr;
} }

@ -3538,7 +3538,7 @@ namespace NLGUI
_RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popin")); _RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popin"));
_RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over")); _RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over"));
_RightButton->setActionOnLeftClick ("ic_popin"); _RightButton->setActionOnLeftClick ("ic_popin");
_RightButton->setDefaultContextHelp(CI18N::get("uiPopinWindow").toUtf8()); _RightButton->setDefaultContextHelp(CI18N::get("uiPopinWindow"));
} }
else // else the container can be deactivated ? deactivate button else // else the container can be deactivated ? deactivate button
{ {
@ -3546,7 +3546,7 @@ namespace NLGUI
_RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_deactive")); _RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_deactive"));
_RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over")); _RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over"));
_RightButton->setActionOnLeftClick ("ic_deactive"); _RightButton->setActionOnLeftClick ("ic_deactive");
_RightButton->setDefaultContextHelp(CI18N::get("uiClose").toUtf8()); _RightButton->setDefaultContextHelp(CI18N::get("uiClose"));
} }
} }
} }
@ -3559,7 +3559,7 @@ namespace NLGUI
_RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popup")); _RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popup"));
_RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over")); _RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over"));
_RightButton->setActionOnLeftClick ("ic_popup"); _RightButton->setActionOnLeftClick ("ic_popup");
_RightButton->setDefaultContextHelp(CI18N::get("uiPopupWindow").toUtf8()); _RightButton->setDefaultContextHelp(CI18N::get("uiPopupWindow"));
} }
_RightButton->setActive(!_Locked); _RightButton->setActive(!_Locked);
} }
@ -3602,7 +3602,7 @@ namespace NLGUI
_HelpButton->setTexturePushed (pLayer->getValStr ("help_button_tx")); _HelpButton->setTexturePushed (pLayer->getValStr ("help_button_tx"));
_HelpButton->setTextureOver (pLayer->getValStr ("help_button_tx_over")); _HelpButton->setTextureOver (pLayer->getValStr ("help_button_tx_over"));
_HelpButton->setActionOnLeftClick ("ic_help"); _HelpButton->setActionOnLeftClick ("ic_help");
_HelpButton->setDefaultContextHelp(CI18N::get("uiHelp").toUtf8()); _HelpButton->setDefaultContextHelp(CI18N::get("uiHelp"));
} }
// if not layer 0 // if not layer 0

@ -3229,7 +3229,7 @@ namespace NLGUI
{ {
if (CI18N::hasTranslation(tooltip)) if (CI18N::hasTranslation(tooltip))
{ {
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip).toUtf8()); ctrlButton->setDefaultContextHelp(CI18N::get(tooltip));
//ctrlButton->setOnContextHelp(CI18N::get(tooltip).toString()); //ctrlButton->setOnContextHelp(CI18N::get(tooltip).toString());
} }
else else
@ -5467,7 +5467,7 @@ namespace NLGUI
{ {
if (CI18N::hasTranslation(tooltip)) if (CI18N::hasTranslation(tooltip))
{ {
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip).toUtf8()); ctrlButton->setDefaultContextHelp(CI18N::get(tooltip));
} }
else else
{ {

@ -1691,7 +1691,7 @@ namespace NLGUI
// inside i18n table // inside i18n table
luabind::module(L, "i18n") luabind::module(L, "i18n")
[ [
luabind::def("get", &CI18N::get), luabind::def("get", &CI18N::getAsUtf16), // FIXME: Lua UTF-8
luabind::def("hasTranslation", &CI18N::hasTranslation) luabind::def("hasTranslation", &CI18N::hasTranslation)
]; ];
// inside 'nlfile' table // inside 'nlfile' table

@ -653,7 +653,7 @@ namespace NLGUI
#if 1 #if 1
if (NLMISC::startsWith(value, "ui")) if (NLMISC::startsWith(value, "ui"))
{ {
_Text = CI18N::get(value).toUtf8(); _Text = CI18N::get(value);
_TextLength = 0; _TextLength = 0;
_HardText = value; _HardText = value;
} }
@ -1000,7 +1000,7 @@ namespace NLGUI
if (NLMISC::startsWith(propPtr, "ui")) if (NLMISC::startsWith(propPtr, "ui"))
{ {
_HardText = propPtr; _HardText = propPtr;
_Text = CI18N::get(propPtr).toUtf8(); _Text = CI18N::get(propPtr);
_TextLength = 0; _TextLength = 0;
} }
else else
@ -1021,11 +1021,11 @@ namespace NLGUI
if (_MultiLine) if (_MultiLine)
{ {
setTextFormatTaged(CI18N::get(propPtr).toUtf8()); setTextFormatTaged(CI18N::get(propPtr));
} }
else else
{ {
setSingleLineTextFormatTaged(CI18N::get(propPtr).toUtf8()); setSingleLineTextFormatTaged(CI18N::get(propPtr));
} }
} }
@ -2394,7 +2394,7 @@ namespace NLGUI
{ {
if (NLMISC::startsWith(ht, "ui")) if (NLMISC::startsWith(ht, "ui"))
{ {
setText(CI18N::get(ht).toUtf8()); setText(CI18N::get(ht));
_HardText = ht; _HardText = ht;
} }
else else
@ -3346,7 +3346,7 @@ namespace NLGUI
pTooltip->setRenderLayer(getRenderLayer()); pTooltip->setRenderLayer(getRenderLayer());
std::string tempTooltipStr = tempTooltips[i].toUtf8(); std::string tempTooltipStr = tempTooltips[i].toUtf8();
bool isI18N = NLMISC::startsWith(tempTooltipStr, "ui"); bool isI18N = NLMISC::startsWith(tempTooltipStr, "ui");
pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltipStr).toUtf8() : tempTooltipStr); pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltipStr) : tempTooltipStr);
pTooltip->setParentPos(this); pTooltip->setParentPos(this);
pTooltip->setParentPosRef(Hotspot_BR); pTooltip->setParentPosRef(Hotspot_BR);
pTooltip->setPosRef(Hotspot_BR); pTooltip->setPosRef(Hotspot_BR);

@ -884,7 +884,7 @@ std::string formatThousands(const std::string& s)
{ {
sint i, k; sint i, k;
sint remaining = (sint)s.length() - 1; sint remaining = (sint)s.length() - 1;
static std::string separator = NLMISC::CI18N::get("uiThousandsSeparator").toUtf8(); static std::string separator = NLMISC::CI18N::get("uiThousandsSeparator");
// Don't add separator if the number is < 10k // Don't add separator if the number is < 10k
if (remaining < 4) return s; if (remaining < 4) return s;

@ -38,15 +38,18 @@ using namespace std;
namespace NLMISC { namespace NLMISC {
CI18N::StrMapContainer CI18N::_StrMap; CI18N::StrMapContainer CI18N::_StrMap;
CI18N::StrMapContainer CI18N::_StrMapFallback; CI18N::StrMapContainer CI18N::_StrMapFallback;
bool CI18N::_StrMapLoaded = false; CI18N::StrMapContainer16 CI18N::_StrMap16;
const ucstring CI18N::_NotTranslatedValue("<Not Translated>"); CI18N::StrMapContainer16 CI18N::_StrMapFallback16;
bool CI18N::_StrMapLoaded = false;
const ucstring CI18N::_NotTranslatedValue16("<Not Translated>");
const std::string CI18N::_NotTranslatedValue("<Not Translated>");
bool CI18N::_LanguagesNamesLoaded = false; bool CI18N::_LanguagesNamesLoaded = false;
string CI18N::_SelectedLanguageCode; string CI18N::_SelectedLanguageCode;
CI18N::ILoadProxy *CI18N::_LoadProxy = 0; CI18N::ILoadProxy *CI18N::_LoadProxy = 0;
vector<string> CI18N::_LanguageCodes; vector<string> CI18N::_LanguageCodes;
vector<ucstring> CI18N::_LanguageNames; vector<std::string> CI18N::_LanguageNames;
std::string CI18N::_SystemLanguageCode; std::string CI18N::_SystemLanguageCode;
bool CI18N::noResolution = false; bool CI18N::noResolution = false;
@ -65,17 +68,17 @@ void CI18N::initLanguages()
_LanguageCodes.push_back("ru"); _LanguageCodes.push_back("ru");
_LanguageCodes.push_back("es"); _LanguageCodes.push_back("es");
_LanguageNames.push_back(ucstring("English")); _LanguageNames.push_back("English");
_LanguageNames.push_back(ucstring("French")); _LanguageNames.push_back("French");
_LanguageNames.push_back(ucstring("German")); _LanguageNames.push_back("German");
_LanguageNames.push_back(ucstring("Russian")); _LanguageNames.push_back("Russian");
_LanguageNames.push_back(ucstring("Spanish")); _LanguageNames.push_back("Spanish");
_LanguagesNamesLoaded = true; _LanguagesNamesLoaded = true;
} }
} }
const std::vector<ucstring> &CI18N::getLanguageNames() const std::vector<std::string> &CI18N::getLanguageNames()
{ {
initLanguages(); initLanguages();
@ -91,19 +94,27 @@ const std::vector<std::string> &CI18N::getLanguageCodes()
void CI18N::load (const string &languageCode, const string &fallbackLanguageCode) void CI18N::load (const string &languageCode, const string &fallbackLanguageCode)
{ {
if (_StrMapLoaded) _StrMap.clear (); if (_StrMapLoaded)
else _StrMapLoaded = true; {
_StrMap.clear();
_StrMap16.clear();
}
else
{
_StrMapLoaded = true;
}
_SelectedLanguageCode = languageCode; _SelectedLanguageCode = languageCode;
loadFileIntoMap(languageCode + ".uxt", _StrMap); loadFileIntoMap(languageCode + ".uxt", _StrMap, _StrMap16);
_StrMapFallback.clear(); _StrMapFallback.clear();
_StrMapFallback16.clear();
if(!fallbackLanguageCode.empty()) if(!fallbackLanguageCode.empty())
{ {
loadFileIntoMap(fallbackLanguageCode + ".uxt", _StrMapFallback); loadFileIntoMap(fallbackLanguageCode + ".uxt", _StrMapFallback, _StrMapFallback16);
} }
} }
bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap) bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap, StrMapContainer16 &destMap16)
{ {
ucstring text; ucstring text;
// read in the text // read in the text
@ -138,11 +149,12 @@ bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap)
// ok, a line read. // ok, a line read.
pair<map<string, ucstring>::iterator, bool> ret; pair<map<string, ucstring>::iterator, bool> ret;
ret = destMap.insert(make_pair(label, ucs)); ret = destMap16.insert(make_pair(label, ucs));
if (!ret.second) if (!ret.second)
{ {
nlwarning("I18N: Error in %s, the label %s exists twice !", fileName.c_str(), label.c_str()); nlwarning("I18N: Error in %s, the label %s exists twice !", fileName.c_str(), label.c_str());
} }
destMap.insert(make_pair(label, ucs.toUtf8()));
skipWhiteSpace(first, last); skipWhiteSpace(first, last);
} }
@ -152,13 +164,15 @@ bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap)
{ {
nlwarning("I18N: In file %s, missing LanguageName translation (should be first in file)", fileName.c_str()); nlwarning("I18N: In file %s, missing LanguageName translation (should be first in file)", fileName.c_str());
} }
nlassert(destMap.size() == destMap16.size());
return true; return true;
} }
void CI18N::loadFromFilename(const string &filename, bool reload) void CI18N::loadFromFilename(const string &filename, bool reload)
{ {
StrMapContainer destMap; StrMapContainer destMap;
if (!loadFileIntoMap(filename, destMap)) StrMapContainer16 destMap16;
if (!loadFileIntoMap(filename, destMap, destMap16))
{ {
return; return;
} }
@ -167,16 +181,52 @@ void CI18N::loadFromFilename(const string &filename, bool reload)
{ {
if (!reload) if (!reload)
{ {
if (_StrMap.count(it->first)) if (_StrMap16.count(it->first))
{ {
nlwarning("I18N: Error in %s, the label %s exist twice !", filename.c_str(), it->first.c_str()); nlwarning("I18N: Error in %s, the label %s exist twice !", filename.c_str(), it->first.c_str());
} }
} }
_StrMap16[it->first] = ucstring::makeFromUtf8(it->second);
_StrMap[it->first] = it->second; _StrMap[it->first] = it->second;
} }
} }
const ucstring &CI18N::get (const string &label) const std::string &CI18N::get(const string &label)
{
if (noResolution)
{
return label;
}
if (label.empty())
{
static const std::string empty;
return empty;
}
StrMapContainer::iterator it(_StrMap.find(label));
if (it != _StrMap.end())
return it->second;
static CHashSet<string> missingStrings;
if (missingStrings.find(label) == missingStrings.end())
{
nlwarning("I18N: The string %s did not exist in language %s (display once)", label.c_str(), _SelectedLanguageCode.c_str());
missingStrings.insert(label);
}
// use the fall back language if it exists
it = _StrMapFallback.find(label);
if (it != _StrMapFallback.end())
return it->second;
static std::string badString;
badString = string("<NotExist:") + label + ">";
return badString;
}
const ucstring &CI18N::getAsUtf16 (const string &label)
{ {
if( noResolution ) if( noResolution )
{ {
@ -187,13 +237,13 @@ const ucstring &CI18N::get (const string &label)
if (label.empty()) if (label.empty())
{ {
static ucstring emptyString; static const ucstring emptyString;
return emptyString; return emptyString;
} }
StrMapContainer::iterator it(_StrMap.find(label)); StrMapContainer16::iterator it(_StrMap16.find(label));
if (it != _StrMap.end()) if (it != _StrMap16.end())
return it->second; return it->second;
static CHashSet<string> missingStrings; static CHashSet<string> missingStrings;
@ -204,8 +254,8 @@ const ucstring &CI18N::get (const string &label)
} }
// use the fall back language if it exists // use the fall back language if it exists
it = _StrMapFallback.find(label); it = _StrMapFallback16.find(label);
if (it != _StrMapFallback.end()) if (it != _StrMapFallback16.end())
return it->second; return it->second;
static ucstring badString; static ucstring badString;
@ -229,7 +279,7 @@ bool CI18N::hasTranslation(const string &label)
return false; return false;
} }
ucstring CI18N::getCurrentLanguageName () std::string CI18N::getCurrentLanguageName ()
{ {
return get("LanguageName"); return get("LanguageName");
} }
@ -379,7 +429,7 @@ std::string CI18N::getSystemLanguageCode ()
// locales names are different under Windows, for example: French_France.1252 // locales names are different under Windows, for example: French_France.1252
for(uint i = 0; i < _LanguageNames.size(); ++i) for(uint i = 0; i < _LanguageNames.size(); ++i)
{ {
std::string name = _LanguageNames[i].toUtf8(); std::string name = _LanguageNames[i];
// so we compare the language name with the supported ones // so we compare the language name with the supported ones
if (lang.compare(0, name.length(), name) == 0) if (lang.compare(0, name.length(), name) == 0)
@ -439,7 +489,7 @@ bool CI18N::setSystemLanguageCode (const std::string &languageCode)
// check if language name is supported // check if language name is supported
for(uint i = 0; i < _LanguageNames.size(); ++i) for(uint i = 0; i < _LanguageNames.size(); ++i)
{ {
std::string name = NLMISC::toLower(_LanguageNames[i].toUtf8()); std::string name = NLMISC::toLower(_LanguageNames[i]);
if (name == lang) if (name == lang)
{ {

@ -230,7 +230,7 @@ void CBGDownloaderAccess::CDownloadCoTask::run()
// that the downloader is still running and in slave mode // that the downloader is still running and in slave mode
if (!isDownloaderProcessRunning() && getDownloaderMode() != DownloaderMode_Slave) if (!isDownloaderProcessRunning() && getDownloaderMode() != DownloaderMode_Slave)
{ {
throw EDownloadException(CI18N::get("uiBGD_DownloaderStopped").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_DownloaderStopped"));
} }
} }
else else
@ -429,7 +429,7 @@ void CBGDownloaderAccess::CDownloadCoTask::createDownloaderProcess()
BOOL ok = NLMISC::launchProgram(BGDownloaderName, Parent->_CommandLine); BOOL ok = NLMISC::launchProgram(BGDownloaderName, Parent->_CommandLine);
if (!ok) if (!ok)
{ {
throw EDownloadException(CI18N::get("uiBGD_LaunchError").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_LaunchError"));
} }
} }
else else
@ -458,7 +458,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
{ {
nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with NULL pid"); nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with NULL pid");
// some problem here ... // some problem here ...
throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance"));
} }
} }
bool ok = NLMISC::CWinProcess::terminateProcess(*(DWORD *) ryzomInstPIDPtr); bool ok = NLMISC::CWinProcess::terminateProcess(*(DWORD *) ryzomInstPIDPtr);
@ -467,7 +467,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
{ {
nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with good pid, but couldn't stop the process"); nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with good pid, but couldn't stop the process");
// couldn't stop the other client ... // couldn't stop the other client ...
throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance"));
} }
} }
// write our pid into shared mem // write our pid into shared mem
@ -475,7 +475,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
if (!Parent->_RyzomInstPIDPtr) if (!Parent->_RyzomInstPIDPtr)
{ {
// really, really bad luck ... // really, really bad luck ...
throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance"));
} }
*(uint32 *) Parent->_RyzomInstPIDPtr = (uint32) GetCurrentProcessId(); *(uint32 *) Parent->_RyzomInstPIDPtr = (uint32) GetCurrentProcessId();
@ -514,7 +514,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
const uint32 totalTries = 7; const uint32 totalTries = 7;
while (waitTime <= 32000) while (waitTime <= 32000)
{ {
Parent->_CurrentMessage.fromUtf8(toString(CI18N::get("uiBGD_HandShaking").toUtf8().c_str(), tryIndex, totalTries)); Parent->_CurrentMessage.fromUtf8(toString(CI18N::get("uiBGD_HandShaking").c_str(), tryIndex, totalTries));
sendSimpleMsg(CL_Probe); sendSimpleMsg(CL_Probe);
NLMISC::CMemStream dummyMsg; NLMISC::CMemStream dummyMsg;
@ -758,7 +758,7 @@ void CBGDownloaderAccess::CDownloadCoTask::waitMsg(BGDownloader::TMsgType wanted
if (msgType != wantedMsgType) if (msgType != wantedMsgType)
{ {
nlwarning("BG DOWNLOADER PROTOCOL ERROR ! Bad message type received. Expected type is '%d', received type is '%d'", (int) wantedMsgType, (int) msgType); nlwarning("BG DOWNLOADER PROTOCOL ERROR ! Bad message type received. Expected type is '%d', received type is '%d'", (int) wantedMsgType, (int) msgType);
throw EDownloadException(CI18N::get("uiBGD_ProtocolError").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_ProtocolError"));
} }
} }
@ -816,7 +816,7 @@ void CBGDownloaderAccess::CDownloadCoTask::checkDownloaderAlive()
{ {
if (!Parent->_DownloaderMsgQueue.connected() || !isDownloaderProcessRunning()) if (!Parent->_DownloaderMsgQueue.connected() || !isDownloaderProcessRunning())
{ {
throw EDownloadException(CI18N::get("uiBGD_DownloaderDisconnected").toUtf8()); throw EDownloadException(CI18N::get("uiBGD_DownloaderDisconnected"));
} }
} }

@ -1176,9 +1176,9 @@ class CHandlerTell : public IActionHandler
void execute (CCtrlBase *pCaller, const std::string &sParams) void execute (CCtrlBase *pCaller, const std::string &sParams)
{ {
string receiver = getParam (sParams, "player"); string receiver = getParam (sParams, "player");
ucstring message; string message;
message.fromUtf8(getParam (sParams, "text")); message = getParam (sParams, "text");
// message = getParam (sParams, "text");
if (receiver.empty() || message.empty()) if (receiver.empty() || message.empty())
return; return;
@ -1194,10 +1194,10 @@ class CHandlerTell : public IActionHandler
// display in the good window // display in the good window
CInterfaceProperty prop; CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
ucstring finalMsg; string finalMsg;
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false);
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); string csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
finalMsg += csr + CI18N::get("youTell") + ": "; finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true);
@ -1206,7 +1206,7 @@ class CHandlerTell : public IActionHandler
// TDataSetIndex dsi; // not used .... // TDataSetIndex dsi; // not used ....
PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA()); PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA());
ucstring s = CI18N::get("youTellPlayer"); string s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver); strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s); strFindReplace(finalMsg, CI18N::get("youTell"), s);
CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell));
@ -1341,9 +1341,7 @@ class CHandlerTalk : public IActionHandler
// Param // Param
uint mode; uint mode;
fromString(getParam (sParams, "mode"), mode); fromString(getParam (sParams, "mode"), mode);
ucstring text; string text = getParam (sParams, "text");
text.fromUtf8 (getParam (sParams, "text"));
// text = getParam (sParams, "text");
// Parse any tokens in the text // Parse any tokens in the text
if ( ! CInterfaceManager::parseTokens(text)) if ( ! CInterfaceManager::parseTokens(text))
@ -1356,7 +1354,7 @@ class CHandlerTalk : public IActionHandler
{ {
if(text[0] == '/') if(text[0] == '/')
{ {
string str = text.toUtf8(); string str = text;
string cmdWithArgs = str.substr(1); string cmdWithArgs = str.substr(1);
// Get the command name from the string, can contain spaces // Get the command name from the string, can contain spaces

@ -983,7 +983,7 @@ bool CItemSheet::canExchangeOrGive(bool botChatGift) const
} }
// *************************************************************************** // ***************************************************************************
void CItemSheet::getItemPartListAsText(ucstring &ipList) const void CItemSheet::getItemPartListAsText(std::string &ipList) const
{ {
bool all= true; bool all= true;
for(uint i=0;i<RM_FABER_TYPE::NUM_FABER_TYPE;i++) for(uint i=0;i<RM_FABER_TYPE::NUM_FABER_TYPE;i++)

@ -466,7 +466,7 @@ public:
bool canExchangeOrGive(bool botChatGift) const; bool canExchangeOrGive(bool botChatGift) const;
// MP only. return translated text of all item part this MP can build. empty, if can't build anything // MP only. return translated text of all item part this MP can build. empty, if can't build anything
void getItemPartListAsText(ucstring &ipList) const; void getItemPartListAsText(std::string &ipList) const;
// get craft plan // get craft plan
const NLMISC::CSheetId &getCraftPlan() const { return CraftPlan; } const NLMISC::CSheetId &getCraftPlan() const { return CraftPlan; }

@ -853,7 +853,7 @@ NLMISC_COMMAND(bugReport, "Call the bug report tool with dump", "<AddScreenshot>
string sys; string sys;
sys = "Language "+CI18N::getCurrentLanguageName().toString() +" "; sys = "Language "+CI18N::getCurrentLanguageName() +" ";
if (!args.empty()) if (!args.empty())
{ {
@ -1306,9 +1306,9 @@ NLMISC_COMMAND(execScript, "Execute a script file (.cmd)","<FileName>")
inComment++; inComment++;
if(inComment<=0) if(inComment<=0)
{ {
ucstring ucline(line); string ucline(line);
CInterfaceManager::parseTokens(ucline); CInterfaceManager::parseTokens(ucline);
ICommand::execute(ucline.toUtf8(), g_log); ICommand::execute(ucline, g_log);
} }
if(strncmp(line, "*/", 2)==0) if(strncmp(line, "*/", 2)==0)
inComment--; inComment--;

@ -1021,7 +1021,7 @@ TInterfaceState globalMenu()
// Display the firewall alert string // Display the firewall alert string
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:outgame:connecting:title")); CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:outgame:connecting:title"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiFirewallAlert").toUtf8() + "..."); pVT->setText(CI18N::get("uiFirewallAlert") + "...");
// The mouse and fullscreen mode should be unlocked for the user to set the firewall permission // The mouse and fullscreen mode should be unlocked for the user to set the firewall permission
nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts
@ -1237,8 +1237,8 @@ TInterfaceState globalMenu()
if (pVT != NULL) if (pVT != NULL)
{ {
pVT->setMultiLine( true ); pVT->setMultiLine( true );
pVT->setText(CI18N::get("uiFirewallFail").toUtf8()+".\n"+ pVT->setText(CI18N::get("uiFirewallFail")+".\n"+
CI18N::get("uiFirewallAlert").toUtf8()+"."); CI18N::get("uiFirewallAlert")+".");
} }
} }
} }
@ -1319,7 +1319,7 @@ public:
if (pVT == NULL) return; if (pVT == NULL) return;
if (rCS.Name.empty()) if (rCS.Name.empty())
pVT->setText(CI18N::get("uiEmptySlot").toUtf8()); pVT->setText(CI18N::get("uiEmptySlot"));
else else
pVT->setText(rCS.Name.toUtf8()); pVT->setText(rCS.Name.toUtf8());
} }
@ -1328,7 +1328,7 @@ public:
{ {
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(sPath+":text"+NLMISC::toString(i))); CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(sPath+":text"+NLMISC::toString(i)));
if (pVT == NULL) return; if (pVT == NULL) return;
pVT->setText(CI18N::get("uiEmptySlot").toUtf8()); pVT->setText(CI18N::get("uiEmptySlot"));
} }
} }
}; };
@ -2682,7 +2682,7 @@ class CAHScenarioControl : public IActionHandler
CViewText* viewText = dynamic_cast<CViewText*>(result); CViewText* viewText = dynamic_cast<CViewText*>(result);
if(viewText) if(viewText)
{ {
viewText->setText(R2::getEditor().isInitialized()?CI18N::get("uiR2EDScenarioName").toUtf8():CI18N::get("uiR2EDScenarioFileName").toUtf8()); viewText->setText(R2::getEditor().isInitialized()?CI18N::get("uiR2EDScenarioName"):CI18N::get("uiR2EDScenarioFileName"));
} }
} }
@ -2694,9 +2694,9 @@ class CAHScenarioControl : public IActionHandler
if(okButton) if(okButton)
{ {
if(R2::getEditor().getAccessMode()!=R2::CEditor::AccessDM) if(R2::getEditor().getAccessMode()!=R2::CEditor::AccessDM)
okButton->setHardText(CI18N::get("uiR2EDLaunchScenario").toString()); okButton->setHardText(CI18N::get("uiR2EDLaunchScenario"));
else else
okButton->setHardText(CI18N::get("uiR2EDApplyScenarioFilters").toString()); okButton->setHardText(CI18N::get("uiR2EDApplyScenarioFilters"));
} }
} }
@ -3184,9 +3184,9 @@ class CAHLoadScenario : public IActionHandler
// -------------------------- // --------------------------
TRuleType ruleType(TRuleType::rt_strict); TRuleType ruleType(TRuleType::rt_strict);
if(rules==CI18N::get("uiR2EDliberal").toString()) if(rules==CI18N::get("uiR2EDliberal"))
ruleType = TRuleType(TRuleType::rt_liberal); ruleType = TRuleType(TRuleType::rt_liberal);
else if(rules == CI18N::get("uiR2EDstrict").toString()) else if(rules == CI18N::get("uiR2EDstrict"))
ruleType = TRuleType(TRuleType::rt_strict); ruleType = TRuleType(TRuleType::rt_strict);
volatile static bool override = false; volatile static bool override = false;
if (override) if (override)
@ -3250,7 +3250,7 @@ class CAHLoadScenario : public IActionHandler
{ {
CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiRingWarningFreeTrial").toUtf8()); pVT->setText(CI18N::get("uiRingWarningFreeTrial"));
CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial");
return; return;
@ -3331,7 +3331,7 @@ class CAHLoadScenario : public IActionHandler
{ {
CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiRingWarningFreeTrial").toUtf8()); pVT->setText(CI18N::get("uiRingWarningFreeTrial"));
CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial");
} }
@ -3360,7 +3360,7 @@ class CAHLoadScenario : public IActionHandler
{ {
CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial").toUtf8()); pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial"));
CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial");
} }
} }

@ -529,7 +529,7 @@ string getDebugInformation()
str += toString("ServerTick: %u\n", NetMngr.getCurrentServerTick()); str += toString("ServerTick: %u\n", NetMngr.getCurrentServerTick());
str += toString("ConnectState: %s\n", NetMngr.getConnectionStateCStr()); str += toString("ConnectState: %s\n", NetMngr.getConnectionStateCStr());
str += toString("LocalAddress: %s\n", NetMngr.getAddress().asString().c_str()); str += toString("LocalAddress: %s\n", NetMngr.getAddress().asString().c_str());
str += toString("Language: %s\n", CI18N::getCurrentLanguageName().toString().c_str()); str += toString("Language: %s\n", CI18N::getCurrentLanguageName().c_str());
str += toString("ClientVersion: %s\n", getDebugVersion().c_str()); str += toString("ClientVersion: %s\n", getDebugVersion().c_str());
if (ClientCfg.R2Mode) if (ClientCfg.R2Mode)
{ {

@ -578,7 +578,7 @@ void checkDriverDepth ()
#else #else
if (mode.Depth != 16 && mode.Depth != 24 && mode.Depth != 32) if (mode.Depth != 16 && mode.Depth != 24 && mode.Depth != 32)
#endif #endif
ExitClientError (CI18N::get ("uiDesktopNotIn32").toUtf8().c_str ()); ExitClientError (CI18N::get ("uiDesktopNotIn32").c_str ());
} }
} }
@ -1058,7 +1058,7 @@ void prelogInit()
if(Driver == NULL) if(Driver == NULL)
{ {
ExitClientError (CI18N::get ("Can_t_load_the_display_driver").toUtf8().c_str ()); ExitClientError (CI18N::get ("Can_t_load_the_display_driver").c_str ());
// ExitClientError() call exit() so the code after is never called // ExitClientError() call exit() so the code after is never called
return; return;
} }
@ -1149,14 +1149,14 @@ void prelogInit()
string msg; string msg;
if (mode.Windowed) if (mode.Windowed)
{ {
msg = CI18N::get ("can_t_create_a_window_display").toUtf8(); msg = CI18N::get ("can_t_create_a_window_display");
} }
else else
{ {
msg = CI18N::get ("can_t_create_a_fullscreen_display").toUtf8(); msg = CI18N::get ("can_t_create_a_fullscreen_display");
} }
msg += " (%dx%d %d "; msg += " (%dx%d %d ";
msg += CI18N::get ("bits").toUtf8 (); msg += CI18N::get ("bits");
msg += ")"; msg += ")";
ExitClientError (msg.c_str (), mode.Width, mode.Height, mode.Depth); ExitClientError (msg.c_str (), mode.Width, mode.Height, mode.Depth);
// ExitClientError() call exit() so the code after is never called // ExitClientError() call exit() so the code after is never called

@ -1692,7 +1692,7 @@ void initBloomConfigUI()
if(!supportBloom) if(!supportBloom)
{ {
if(group) if(group)
group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom").toUtf8()); group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom"));
ClientCfg.writeBool("FXAA", false); ClientCfg.writeBool("FXAA", false);
ClientCfg.writeBool("Bloom", false); ClientCfg.writeBool("Bloom", false);

@ -2140,7 +2140,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
pVBR->setColor(CRGBA(0,0,0,0)); pVBR->setColor(CRGBA(0,0,0,0));
if (pTooltip) if (pTooltip)
pTooltip->setDefaultContextHelp(CI18N::get("uittTargetUnknown").toUtf8()); pTooltip->setDefaultContextHelp(CI18N::get("uittTargetUnknown"));
return; return;
} }
@ -2205,7 +2205,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
sint min = (nForceRegion-2) * 50 + (nLevelForce-1) * 10 + 1; sint min = (nForceRegion-2) * 50 + (nLevelForce-1) * 10 + 1;
sint max = (nForceRegion-2) * 50 + nLevelForce * 10; sint max = (nForceRegion-2) * 50 + nLevelForce * 10;
str= CI18N::get("uittTargetLevel").toUtf8(); str= CI18N::get("uittTargetLevel");
strFindReplace(str, "%min", toString(min)); strFindReplace(str, "%min", toString(min));
strFindReplace(str, "%max", toString(max)); strFindReplace(str, "%max", toString(max));
} }
@ -2214,16 +2214,16 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
{ {
sint n = (nForceRegion-1) * 50; sint n = (nForceRegion-1) * 50;
if (pE->isNPC()) if (pE->isNPC())
str= CI18N::get("uittTargetGuardBoss").toUtf8(); str= CI18N::get("uittTargetGuardBoss");
else else
str= CI18N::get("uittTargetBoss").toUtf8(); str= CI18N::get("uittTargetBoss");
strFindReplace(str, "%n", toString("%d", n) ); strFindReplace(str, "%n", toString("%d", n) );
} }
// Named // Named
else else
{ {
sint n = (nForceRegion-1) * 50; sint n = (nForceRegion-1) * 50;
str= CI18N::get("uittTargetNamed").toUtf8(); str= CI18N::get("uittTargetNamed");
strFindReplace(str, "%n", toString("%d", n) ); strFindReplace(str, "%n", toString("%d", n) );
} }
@ -3094,10 +3094,10 @@ public:
if( pCB ) if( pCB )
{ {
pCB->resetTexts(); pCB->resetTexts();
pCB->addText(CI18N::get("uigcLowTextureMode").toUtf8()); pCB->addText(CI18N::get("uigcLowTextureMode"));
pCB->addText(CI18N::get("uigcNormalTextureMode").toUtf8()); pCB->addText(CI18N::get("uigcNormalTextureMode"));
if(ClientCfg.HDTextureInstalled) if(ClientCfg.HDTextureInstalled)
pCB->addText(CI18N::get("uigcHighTextureMode").toUtf8()); pCB->addText(CI18N::get("uigcHighTextureMode"));
} }
// Anisotropic Filtering // Anisotropic Filtering
@ -3110,7 +3110,7 @@ public:
sint maxAnisotropic = (sint)Driver->getAnisotropicFilterMaximum(); sint maxAnisotropic = (sint)Driver->getAnisotropicFilterMaximum();
pCB->resetTexts(); pCB->resetTexts();
pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone").toUtf8()); pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone"));
sint anisotropic = 2; sint anisotropic = 2;
uint i = 1; uint i = 1;

@ -992,9 +992,7 @@ class CHandlerBrowse : public IActionHandler
} }
} }
ucstring ucparams(params); CInterfaceManager::parseTokens(params);
CInterfaceManager::parseTokens(ucparams);
params = ucparams.toUtf8();
// go. NB: the action handler himself may translate params from utf8 // go. NB: the action handler himself may translate params from utf8
CAHManager::getInstance()->runActionHandler(action, elementGroup, params); CAHManager::getInstance()->runActionHandler(action, elementGroup, params);
@ -2014,7 +2012,7 @@ void getItemText (CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS)
if(pIS->canBuildSomeItemPart()) if(pIS->canBuildSomeItemPart())
{ {
ucstring fmt= CI18N::get("uihelpItemMPCraft"); ucstring fmt= CI18N::get("uihelpItemMPCraft");
ucstring ipList; std::string ipList;
pIS->getItemPartListAsText(ipList); pIS->getItemPartListAsText(ipList);
strFindReplace(fmt, "%ip", ipList); strFindReplace(fmt, "%ip", ipList);
strFindReplace(itemText, "%craft", fmt); strFindReplace(itemText, "%craft", fmt);
@ -2200,7 +2198,7 @@ static void setupRawMaterialStats(CSheetHelpSetup &setup)
if(pIS->canBuildItemPart(faberType)) if(pIS->canBuildItemPart(faberType))
{ {
pCB->addText(RM_FABER_TYPE::toLocalString(faberType).toUtf8()); pCB->addText(RM_FABER_TYPE::toLocalString(faberType));
} }
} }
@ -3165,7 +3163,7 @@ void setupListBrickHeader(CSheetHelpSetup &setup)
if(view) if(view)
{ {
view->setActive(true); view->setActive(true);
view->setTextFormatTaged(CI18N::get("uihelpPhraseHeaderBricks").toUtf8()); view->setTextFormatTaged(CI18N::get("uihelpPhraseHeaderBricks"));
} }
} }
@ -3476,73 +3474,73 @@ void setConsoModSuccessTooltip( CDBCtrlSheet *cs )
string ustr; string ustr;
if( CSheetId(cs->getSheetId()).toString() == "mod_melee_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_melee_success.sbrick" )
{ {
ustr = CI18N::get("uittModMeleeSuccess").toUtf8(); ustr = CI18N::get("uittModMeleeSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:MELEE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:MELEE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_range_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_range_success.sbrick" )
{ {
ustr = CI18N::get("uittModRangeSuccess").toUtf8(); ustr = CI18N::get("uittModRangeSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:RANGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:RANGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_craft_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_craft_success.sbrick" )
{ {
ustr = CI18N::get("uittModCraftSuccess").toUtf8(); ustr = CI18N::get("uittModCraftSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:CRAFT", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:CRAFT", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_defense_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_defense_success.sbrick" )
{ {
ustr = CI18N::get("uittModDefenseSuccess").toUtf8(); ustr = CI18N::get("uittModDefenseSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:DODGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:DODGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_dodge_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_dodge_success.sbrick" )
{ {
ustr = CI18N::get("uittModDodgeSuccess").toUtf8(); ustr = CI18N::get("uittModDodgeSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:DODGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:DODGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_parry_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_parry_success.sbrick" )
{ {
ustr = CI18N::get("uittModParrySuccess").toUtf8(); ustr = CI18N::get("uittModParrySuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:PARRY", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:PARRY", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_forage_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_forage_success.sbrick" )
{ {
ustr = CI18N::get("uittModForageSuccess").toUtf8(); ustr = CI18N::get("uittModForageSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::common_ecosystem)+":FORAGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::common_ecosystem)+":FORAGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_desert_forage_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_desert_forage_success.sbrick" )
{ {
ustr = CI18N::get("uittModDesertForageSuccess").toUtf8(); ustr = CI18N::get("uittModDesertForageSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::desert)+":FORAGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::desert)+":FORAGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_forest_forage_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_forest_forage_success.sbrick" )
{ {
ustr = CI18N::get("uittModForestForageSuccess").toUtf8(); ustr = CI18N::get("uittModForestForageSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::forest)+":FORAGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::forest)+":FORAGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_lacustre_forage_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_lacustre_forage_success.sbrick" )
{ {
ustr = CI18N::get("uittModLacustreForageSuccess").toUtf8(); ustr = CI18N::get("uittModLacustreForageSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::lacustre)+":FORAGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::lacustre)+":FORAGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_jungle_forage_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_jungle_forage_success.sbrick" )
{ {
ustr = CI18N::get("uittModJungleForageSuccess").toUtf8(); ustr = CI18N::get("uittModJungleForageSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::jungle)+":FORAGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::jungle)+":FORAGE", false);
} }
else else
if( CSheetId(cs->getSheetId()).toString() == "mod_primary_root_forage_success.sbrick" ) if( CSheetId(cs->getSheetId()).toString() == "mod_primary_root_forage_success.sbrick" )
{ {
ustr = CI18N::get("uittModPrimaryRootForageSuccess").toUtf8(); ustr = CI18N::get("uittModPrimaryRootForageSuccess");
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::primary_root)+":FORAGE", false); nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::primary_root)+":FORAGE", false);
} }
@ -3576,19 +3574,19 @@ public:
// special tooltip? (pvp outpost and xp catalyzer) // special tooltip? (pvp outpost and xp catalyzer)
sint specialTTId= getBonusMalusSpecialTT(cs); sint specialTTId= getBonusMalusSpecialTT(cs);
if(specialTTId==BONUS_MALUS::XpCatalyser) if(specialTTId==BONUS_MALUS::XpCatalyser)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittXpBonus").toUtf8()); CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittXpBonus"));
else if(specialTTId==BONUS_MALUS::OutpostPVPOn) else if(specialTTId==BONUS_MALUS::OutpostPVPOn)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOn").toUtf8()); CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOn"));
else if(specialTTId==BONUS_MALUS::OutpostPVPOutOfZone) else if(specialTTId==BONUS_MALUS::OutpostPVPOutOfZone)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOutOfZone").toUtf8()); CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOutOfZone"));
else if(specialTTId==BONUS_MALUS::OutpostPVPInRound) else if(specialTTId==BONUS_MALUS::OutpostPVPInRound)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostInRound").toUtf8()); CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostInRound"));
else if(specialTTId==BONUS_MALUS::DeathPenalty) else if(specialTTId==BONUS_MALUS::DeathPenalty)
{ {
CCDBNodeLeaf * node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEATH_XP_MALUS", false); CCDBNodeLeaf * node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEATH_XP_MALUS", false);
if( node ) if( node )
{ {
string txt = CI18N::get("uittDeathPenalty").toUtf8(); string txt = CI18N::get("uittDeathPenalty");
strFindReplace(txt, "%dp", toString((100*node->getValue16())/254)); strFindReplace(txt, "%dp", toString((100*node->getValue16())/254));
CWidgetManager::getInstance()->setContextHelpText(txt); CWidgetManager::getInstance()->setContextHelpText(txt);
} }
@ -3600,7 +3598,7 @@ public:
std::string str; std::string str;
cs->getContextHelp(str); cs->getContextHelp(str);
str+= CI18N::get("uittAuraDisabled").toUtf8(); str+= CI18N::get("uittAuraDisabled");
// and replace the context help that is required. // and replace the context help that is required.
CWidgetManager::getInstance()->setContextHelpText(str); CWidgetManager::getInstance()->setContextHelpText(str);
@ -3838,7 +3836,7 @@ static void onMpChangeItemPart(CInterfaceGroup *wnd, uint32 itemSheetId, const s
CViewText *statTitle= dynamic_cast<CViewText*>(groupStat->getElement(groupStat->getId()+":text" )); CViewText *statTitle= dynamic_cast<CViewText*>(groupStat->getElement(groupStat->getId()+":text" ));
CDBViewBar *statValue= dynamic_cast<CDBViewBar*>(groupStat->getElement(groupStat->getId()+":bar" )); CDBViewBar *statValue= dynamic_cast<CDBViewBar*>(groupStat->getElement(groupStat->getId()+":bar" ));
if(statTitle) if(statTitle)
statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType).toUtf8()); statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType));
if(statValue) if(statValue)
statValue->setValue(itemPart.Stats[i]); statValue->setValue(itemPart.Stats[i]);
} }

@ -1790,7 +1790,7 @@ void CActionPhraseFaber::updateItemResult()
uint sv= uint(statArray[i]*100); uint sv= uint(statArray[i]*100);
if(statTitle) if(statTitle)
{ {
statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType).toUtf8()); statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType));
statTitle->setColor(usageColor); statTitle->setColor(usageColor);
} }
if(statValueBar) if(statValueBar)
@ -1810,12 +1810,12 @@ void CActionPhraseFaber::updateItemResult()
// display something only for magic/protect stat // display something only for magic/protect stat
if( RM_FABER_STAT_TYPE::isMagicResistStat(RM_FABER_STAT_TYPE::TRMStatType(i)) || if( RM_FABER_STAT_TYPE::isMagicResistStat(RM_FABER_STAT_TYPE::TRMStatType(i)) ||
RM_FABER_STAT_TYPE::isMagicProtectStat(RM_FABER_STAT_TYPE::TRMStatType(i)) ) RM_FABER_STAT_TYPE::isMagicProtectStat(RM_FABER_STAT_TYPE::TRMStatType(i)) )
statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatActive").toUtf8()); statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatActive"));
else else
statToolTip->setDefaultContextHelp(std::string()); statToolTip->setDefaultContextHelp(std::string());
} }
else else
statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed").toUtf8()); statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed"));
} }
} }

@ -189,7 +189,7 @@ void CBotChatPageDynamicMission::update()
else else
{ {
// add a text to show the player that the text is being received // add a text to show the player that the text is being received
_ChoiceCB[k]->addText(NLMISC::CI18N::get("uiWaitingChoiceFromServer").toUtf8()); _ChoiceCB[k]->addText(NLMISC::CI18N::get("uiWaitingChoiceFromServer"));
} }
} }
} }

@ -600,12 +600,12 @@ void CBotChatPageTrade::updateTradeModal()
if (_BuyMean == MoneyGuildXP) if (_BuyMean == MoneyGuildXP)
{ {
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney"));
} }
else else
{ {
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildMoney")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildMoney").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildMoney"));
} }
return; return;
} }
@ -616,7 +616,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP"));
return; return;
} }
} }
@ -677,7 +677,7 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
// can't sell more than what is in inventory // can't sell more than what is in inventory
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBCNotAvailable")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBCNotAvailable"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBCNotAvailable").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBCNotAvailable"));
ok= false; ok= false;
} }
@ -692,7 +692,7 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
// can't sell more than what is in inventory // can't sell more than what is in inventory
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity"));
ok= false; ok= false;
} }
} }
@ -710,7 +710,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney"));
} }
else if (_BuyMean == MoneyFactionPoints) else if (_BuyMean == MoneyFactionPoints)
{ {
@ -722,7 +722,7 @@ void CBotChatPageTrade::updateTradeModal()
confirmTradeGroup->setActive(false); confirmTradeGroup->setActive(false);
cantTradeGroup->setActive(true); cantTradeGroup->setActive(true);
cantTradeButton->setText(CI18N::get("uiNotEnoughFP_"+PVP_CLAN::toString(fpType))); cantTradeButton->setText(CI18N::get("uiNotEnoughFP_"+PVP_CLAN::toString(fpType)));
cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughFP_"+PVP_CLAN::toString(fpType)).toUtf8()); cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughFP_"+PVP_CLAN::toString(fpType)));
} }
else else
{ {
@ -745,7 +745,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughSkillPoints")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughSkillPoints"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughSkillPoints").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughSkillPoints"));
} }
else else
{ {
@ -761,7 +761,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP"));
} }
else else
{ {
@ -780,7 +780,7 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeGroup) cantTradeGroup->setActive(true);
// can't sell less than the basic price // can't sell less than the basic price
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadResalePrice")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadResalePrice"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadResalePrice").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadResalePrice"));
} }
// else ok, can resell // else ok, can resell
else else
@ -812,7 +812,7 @@ void CBotChatPageTrade::updateTradeModal()
if (_SellDlgOn && priceWithoutFame == 0) if (_SellDlgOn && priceWithoutFame == 0)
{ {
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiWontBuyThis")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiWontBuyThis"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittWontBuyThis").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittWontBuyThis"));
} }
else if (_SellDlgOn && priceWithoutFame == std::numeric_limits<uint64>::max()) else if (_SellDlgOn && priceWithoutFame == std::numeric_limits<uint64>::max())
{ {
@ -821,7 +821,7 @@ void CBotChatPageTrade::updateTradeModal()
else if (quantity == 0 || quantity == std::numeric_limits<uint32>::max()) else if (quantity == 0 || quantity == std::numeric_limits<uint32>::max())
{ {
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity").toUtf8()); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity"));
} }
} }
} }
@ -865,7 +865,7 @@ void CBotChatPageTrade::startBuyDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCall
CViewText *priceLabel = dynamic_cast<CViewText*>(ig->getView( "standard_price:total_price_header" )); CViewText *priceLabel = dynamic_cast<CViewText*>(ig->getView( "standard_price:total_price_header" ));
if ( _BuyMean == Money && priceLabel ) if ( _BuyMean == Money && priceLabel )
{ {
priceLabel->setText( CI18N::get( "uiPrice" ).toUtf8() ); priceLabel->setText( CI18N::get( "uiPrice" ) );
priceLabel->setActive(true); priceLabel->setActive(true);
} }
else else
@ -977,7 +977,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal
CViewText *priceLabel = dynamic_cast<CViewText*>(ig->getView( "standard_price:total_price_header" )); CViewText *priceLabel = dynamic_cast<CViewText*>(ig->getView( "standard_price:total_price_header" ));
if ( priceLabel ) if ( priceLabel )
{ {
priceLabel->setText( CI18N::get( "uiImmediatePrice" ).toUtf8() ); priceLabel->setText( CI18N::get( "uiImmediatePrice" ) );
priceLabel->setActive(true); priceLabel->setActive(true);
} }
@ -1003,7 +1003,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal
{ {
confirmButton->setActive( !sheet->getLockedByOwner() ); confirmButton->setActive( !sheet->getLockedByOwner() );
confirmButton->setText(CI18N::get("uiSellImmediately")); confirmButton->setText(CI18N::get("uiSellImmediately"));
confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton").toUtf8()); confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton"));
} }
// set item or skill name // set item or skill name

@ -472,25 +472,25 @@ void CChatWindow::setHeaderColor(const std::string &n)
//================================================================================= //=================================================================================
void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/) void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/)
{ {
ucstring finalMsg; string finalMsg;
CInterfaceProperty prop; CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
encodeColorTag(prop.getRGBA(), finalMsg, false); encodeColorTag(prop.getRGBA(), finalMsg, false);
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); string csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
finalMsg += csr + CI18N::get("youTell") + ": "; finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
encodeColorTag(prop.getRGBA(), finalMsg, true); encodeColorTag(prop.getRGBA(), finalMsg, true);
finalMsg += msg; finalMsg += msg.toUtf8();
ucstring s = CI18N::get("youTellPlayer"); string s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver); strFindReplace(s, "%name", receiver.toUtf8());
strFindReplace(finalMsg, CI18N::get("youTell"), s); strFindReplace(finalMsg, CI18N::get("youTell"), s);
displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks); displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks);
CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell));
} }
void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append) void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, std::string &text, bool append)
{ {
// WARNING : The lookup table MUST contains 17 element (with the last doubled) // WARNING : The lookup table MUST contains 17 element (with the last doubled)
// because we add 7 to the 8 bit color before shifting to right in order to match color // because we add 7 to the 8 bit color before shifting to right in order to match color
@ -498,8 +498,8 @@ void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, boo
// Have 17 entry remove the need for a %16 for each color component. // Have 17 entry remove the need for a %16 for each color component.
// By the way, this comment is more longer to type than to add the %16... // By the way, this comment is more longer to type than to add the %16...
// //
static ucchar ConvTable[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'F'}; static char ConvTable[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'F'};
ucstring str; string str;
if (append) if (append)
{ {
str.reserve(7 + str.size()); str.reserve(7 + str.size());
@ -1273,7 +1273,7 @@ public:
{ {
CGroupEditBox *pEB = dynamic_cast<CGroupEditBox*>(pCaller); CGroupEditBox *pEB = dynamic_cast<CGroupEditBox*>(pCaller);
if (pEB == NULL) return; if (pEB == NULL) return;
ucstring text = pEB->getInputStringAsUtf16(); string text = pEB->getInputString();
// If the line is empty, do nothing // If the line is empty, do nothing
if(text.empty()) if(text.empty())
return; return;
@ -1297,7 +1297,7 @@ public:
if(text[0] == '/') if(text[0] == '/')
{ {
CChatWindow::_ChatWindowLaunchingCommand = chat; CChatWindow::_ChatWindowLaunchingCommand = chat;
string str = text.toUtf8(); string str = text;
string cmdWithArgs = str.substr(1); string cmdWithArgs = str.substr(1);
// Get the command name from the string, can contain spaces // Get the command name from the string, can contain spaces

@ -156,7 +156,7 @@ public:
void displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks = 0); void displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks = 0);
/// Encode a color tag '@{RGBA}' in the text. If append is true, append at end of text, otherwise, replace the text /// Encode a color tag '@{RGBA}' in the text. If append is true, append at end of text, otherwise, replace the text
static void encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append=true); static void encodeColorTag(const NLMISC::CRGBA &color, std::string &text, bool append=true);
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
protected: protected:

@ -1119,10 +1119,10 @@ void CDBGroupBuildPhrase::updateAllDisplay(const CSPhraseCom &phrase)
{ {
word.InfoView->setActive(true); word.InfoView->setActive(true);
if(i==0) if(i==0)
word.InfoView->setText( CI18N::get("uiTextHelpSelectRootBrick").toUtf8() ); word.InfoView->setText( CI18N::get("uiTextHelpSelectRootBrick") );
else else
// start effect index at 1 (human readable :) ) // start effect index at 1 (human readable :) )
word.InfoView->setText( CI18N::get("uiTextHelpSelectEffectBrick").toUtf8() + toString(i) ); word.InfoView->setText( CI18N::get("uiTextHelpSelectEffectBrick") + toString(i) );
} }
} }

@ -1058,7 +1058,7 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem()
if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item) if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item)
{ {
if(!Ctrl->checkItemRequirement()) if(!Ctrl->checkItemRequirement())
text= CI18N::get("uiItemCannotUseColor").toUtf8() + text; text= CI18N::get("uiItemCannotUseColor") + text;
} }
// For item, add some information // For item, add some information
@ -1070,17 +1070,17 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem()
// Add craft info for MP // Add craft info for MP
if(pIS->Family==ITEMFAMILY::RAW_MATERIAL) if(pIS->Family==ITEMFAMILY::RAW_MATERIAL)
{ {
ucstring ipList; string ipList;
pIS->getItemPartListAsText(ipList); pIS->getItemPartListAsText(ipList);
if(ipList.empty()) if(ipList.empty())
{ {
if(pIS->isUsedAsCraftRequirement()) if(pIS->isUsedAsCraftRequirement())
text+= "\n" + CI18N::get("uiItemMpCraftRequirement").toUtf8(); text+= "\n" + CI18N::get("uiItemMpCraftRequirement");
else else
text+= "\n" + CI18N::get("uiItemMpNoCraft").toUtf8(); text+= "\n" + CI18N::get("uiItemMpNoCraft");
} }
else else
text+= "\n" + CI18N::get("uiItemMpCanCraft").toUtf8() + ipList.toUtf8(); text+= "\n" + CI18N::get("uiItemMpCanCraft") + ipList;
} }
} }
} }

@ -254,10 +254,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
switch ( Ctrl->getSheetCategory() ) switch ( Ctrl->getSheetCategory() )
{ {
case CDBCtrlSheet::Item: break; // none for item. consider useless case CDBCtrlSheet::Item: break; // none for item. consider useless
case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact").toUtf8() + text; break; case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact") + text; break;
case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill").toUtf8() + text; break; case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill") + text; break;
case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill").toUtf8() + text; break; case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill") + text; break;
case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase").toUtf8() + text; break; case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase") + text; break;
default: break; default: break;
} }
@ -269,10 +269,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
text += string("\n") + CUtfStringView(pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()))).toUtf8(); text += string("\n") + CUtfStringView(pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()))).toUtf8();
text += "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(pOBS->CostDapper)); text += "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pOBS->CostDapper));
text += CI18N::get("uiBotChatTime").toUtf8() + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute").toUtf8(); text += CI18N::get("uiBotChatTime") + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute");
if ((pOBS->CostTime % 60) != 0) if ((pOBS->CostTime % 60) != 0)
text += toString(pOBS->CostTime%60) + CI18N::get("uiBotChatTimeSecond").toUtf8(); text += toString(pOBS->CostTime%60) + CI18N::get("uiBotChatTimeSecond");
} }
} }
@ -285,7 +285,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
bool melee,range; bool melee,range;
pPM->getCombatWeaponRestriction(weaponRestriction, Ctrl->getSheetId(),melee,range); pPM->getCombatWeaponRestriction(weaponRestriction, Ctrl->getSheetId(),melee,range);
// don't add also if no combat restriction // don't add also if no combat restriction
if(!weaponRestriction.empty() && weaponRestriction!=CI18N::get("uiawrSF")) if(!weaponRestriction.empty() && weaponRestriction!=CI18N::getAsUtf16("uiawrSF"))
{ {
weaponRestriction= CI18N::get("uiPhraseWRHeader") + weaponRestriction; weaponRestriction= CI18N::get("uiPhraseWRHeader") + weaponRestriction;
text+= "\n" + weaponRestriction.toUtf8(); text+= "\n" + weaponRestriction.toUtf8();
@ -297,7 +297,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item) if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item)
{ {
if(!Ctrl->checkItemRequirement()) if(!Ctrl->checkItemRequirement())
colorTag= CI18N::get("uiItemCannotUseColor").toUtf8(); colorTag= CI18N::get("uiItemCannotUseColor");
} }
// For item, add some information // For item, add some information
@ -309,17 +309,17 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
// Add craft info for MP // Add craft info for MP
if(pIS->Family==ITEMFAMILY::RAW_MATERIAL) if(pIS->Family==ITEMFAMILY::RAW_MATERIAL)
{ {
ucstring ipList; string ipList;
pIS->getItemPartListAsText(ipList); pIS->getItemPartListAsText(ipList);
if(ipList.empty()) if(ipList.empty())
{ {
if(pIS->isUsedAsCraftRequirement()) if(pIS->isUsedAsCraftRequirement())
text+= "\n" + CI18N::get("uiItemMpCraftRequirement").toUtf8(); text+= "\n" + CI18N::get("uiItemMpCraftRequirement");
else else
text+= "\n" + CI18N::get("uiItemMpNoCraft").toUtf8(); text+= "\n" + CI18N::get("uiItemMpNoCraft");
} }
else else
text+= "\n" + CI18N::get("uiItemMpCanCraft").toUtf8() + ipList.toUtf8(); text+= "\n" + CI18N::get("uiItemMpCanCraft") + ipList;
} }
} }
} }
@ -331,9 +331,9 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(Ctrl->getSheetCategory() == CDBCtrlSheet::Phrase) if(Ctrl->getSheetCategory() == CDBCtrlSheet::Phrase)
{ {
if (LastPrice != -1) if (LastPrice != -1)
text+= "\n" + CI18N::get("uiBotChatSkillPointCost").toUtf8() + toString(LastPrice); text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(LastPrice);
else else
text+= "\n" + CI18N::get("uiBotChatSkillPointCostNotReceived").toUtf8(); text+= "\n" + CI18N::get("uiBotChatSkillPointCostNotReceived");
} }
else else
{ {
@ -345,8 +345,8 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
const CItemSheet *pIS = Ctrl->asItemSheet(); const CItemSheet *pIS = Ctrl->asItemSheet();
if (pIS && pIS->Family == ITEMFAMILY::GUILD_OPTION) if (pIS && pIS->Family == ITEMFAMILY::GUILD_OPTION)
{ {
text+= "\n" + CI18N::get("uiBotChatSkillPointCost").toUtf8() + toString(pIS->GuildOption.XPCost); text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(pIS->GuildOption.XPCost);
text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost)); text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost));
guildOption= true; guildOption= true;
} }
} }
@ -381,10 +381,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if (LastPrice > 0) if (LastPrice > 0)
{ {
if(displayMulPrice) if(displayMulPrice)
text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(sint32(LastPrice * priceFactor))) + " (" text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(sint32(LastPrice * priceFactor))) + " ("
+ NLMISC::formatThousands(toString( sint32(factor) * sint32(LastPrice * priceFactor) )) + ")"; + NLMISC::formatThousands(toString( sint32(factor) * sint32(LastPrice * priceFactor) )) + ")";
else else
text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString( sint32(factor * LastPrice * priceFactor) )); text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString( sint32(factor * LastPrice * priceFactor) ));
} }
if ((LastFactionPointPrice != 0) && (LastFactionType >= PVP_CLAN::BeginClans) && (LastFactionType <= PVP_CLAN::EndClans)) if ((LastFactionPointPrice != 0) && (LastFactionType >= PVP_CLAN::BeginClans) && (LastFactionType <= PVP_CLAN::EndClans))
@ -394,8 +394,8 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
else else
text+= "\n"; text+= "\n";
text+= CI18N::get("uiBotChatFactionType").toUtf8() + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType) text+= CI18N::get("uiBotChatFactionType") + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType)
+ CI18N::get("uiBotChatFactionPointPrice").toUtf8() + NLMISC::formatThousands(toString(LastFactionPointPrice)); + CI18N::get("uiBotChatFactionPointPrice") + NLMISC::formatThousands(toString(LastFactionPointPrice));
} }
// some additional info for resale // some additional info for resale
@ -407,31 +407,31 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
{ {
// append price // append price
if(pIS && pIS->Stackable>1 && zeFather->getMultiplyPriceByQuantityFlag()) if(pIS && pIS->Stackable>1 && zeFather->getMultiplyPriceByQuantityFlag())
text+= CI18N::get("uiBotChatRetirePrice").toUtf8() + NLMISC::formatThousands(toString(LastPriceRetire)) + " (" text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(LastPriceRetire)) + " ("
+ NLMISC::formatThousands(toString(factor * LastPriceRetire)) + ")"; + NLMISC::formatThousands(toString(factor * LastPriceRetire)) + ")";
else else
text+= CI18N::get("uiBotChatRetirePrice").toUtf8() + NLMISC::formatThousands(toString(factor * LastPriceRetire)); text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(factor * LastPriceRetire));
// set resale time left // set resale time left
std::string fmt= CI18N::get("uiBotChatResaleTimeLeft").toUtf8(); std::string fmt= CI18N::get("uiBotChatResaleTimeLeft");
strFindReplace(fmt, "%d", toString(LastResaleTimeLeft/RYZOM_DAY_IN_HOUR)); strFindReplace(fmt, "%d", toString(LastResaleTimeLeft/RYZOM_DAY_IN_HOUR));
strFindReplace(fmt, "%h", toString(LastResaleTimeLeft%RYZOM_DAY_IN_HOUR)); strFindReplace(fmt, "%h", toString(LastResaleTimeLeft%RYZOM_DAY_IN_HOUR));
text+= "\n" + fmt; text+= "\n" + fmt;
// force special color (according if retirable or not) // force special color (according if retirable or not)
if(LastSellerType == BOTCHATTYPE::UserRetirable || LastSellerType == BOTCHATTYPE::ResaleAndUserRetirable) if(LastSellerType == BOTCHATTYPE::UserRetirable || LastSellerType == BOTCHATTYPE::ResaleAndUserRetirable)
colorTag= CI18N::get("uiItemUserSellColor").toUtf8(); colorTag= CI18N::get("uiItemUserSellColor");
else else
colorTag= CI18N::get("uiItemUserSellColorNotRetirable").toUtf8(); colorTag= CI18N::get("uiItemUserSellColorNotRetirable");
} }
// Append (NPC) tag if NPC item // Append (NPC) tag if NPC item
if(LastSellerType == BOTCHATTYPE::NPC) if(LastSellerType == BOTCHATTYPE::NPC)
{ {
text+= "\n" + CI18N::get("uiBotChatNPCTag").toUtf8(); text+= "\n" + CI18N::get("uiBotChatNPCTag");
} }
// else display the name of the vendor (not if this is the player himself, to avoid flood) // else display the name of the vendor (not if this is the player himself, to avoid flood)
else if (LastSellerType == BOTCHATTYPE::Resale) else if (LastSellerType == BOTCHATTYPE::Resale)
{ {
text+= "\n" + CI18N::get("uiBotChatVendorTag").toUtf8() + VendorNameString.toUtf8(); text+= "\n" + CI18N::get("uiBotChatVendorTag") + VendorNameString.toUtf8();
} }
} }
} }
@ -441,14 +441,14 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(zeFather->sellerTypeWanted() && if(zeFather->sellerTypeWanted() &&
(LastSellerType == BOTCHATTYPE::User || LastSellerType == BOTCHATTYPE::UserRetirable) ) (LastSellerType == BOTCHATTYPE::User || LastSellerType == BOTCHATTYPE::UserRetirable) )
{ {
text+= "\n" + CI18N::get("uiItemSold").toUtf8(); text+= "\n" + CI18N::get("uiItemSold");
// force special color // force special color
colorTag= CI18N::get("uiItemSoldColor").toUtf8(); colorTag= CI18N::get("uiItemSoldColor");
} }
// error case // error case
else else
{ {
text+= "\n" + CI18N::get("uiPriceNotReceived").toUtf8(); text+= "\n" + CI18N::get("uiPriceNotReceived");
} }
} }
} }

@ -425,7 +425,7 @@ void CGroupCompas::draw()
if (toolTip) if (toolTip)
{ {
if (displayedTarget.getType() != CCompassTarget::North) if (displayedTarget.getType() != CCompassTarget::North)
toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance"));
else else
toolTip->setDefaultContextHelp(std::string()); toolTip->setDefaultContextHelp(std::string());
} }

@ -1122,7 +1122,7 @@ void CGroupInSceneUserInfo::updateDynamicData ()
{ {
CInterfaceGroup *group = getGroup ("right"); CInterfaceGroup *group = getGroup ("right");
CForageSourceCL *forageSource = static_cast<CForageSourceCL*>(_Entity); CForageSourceCL *forageSource = static_cast<CForageSourceCL*>(_Entity);
string txt( CI18N::get( "uittForageContent" ).toUtf8() + toString( ": %u", forageSource->getCurrentQuantity() ) ); string txt( CI18N::get( "uittForageContent" ) + toString( ": %u", forageSource->getCurrentQuantity() ) );
CCtrlBase *toolTip = group->getCtrl ("tt1"); CCtrlBase *toolTip = group->getCtrl ("tt1");
if ( toolTip ) if ( toolTip )
toolTip->setDefaultContextHelp( txt ); toolTip->setDefaultContextHelp( txt );

@ -697,7 +697,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
{ {
_HomeLM->setParent(this); _HomeLM->setParent(this);
addCtrl(_HomeLM); addCtrl(_HomeLM);
_HomeLM->setDefaultContextHelp(NLMISC::CI18N::get("uiHome").toUtf8()); _HomeLM->setDefaultContextHelp(NLMISC::CI18N::get("uiHome"));
} }
// create animals Landmark: pack Animals. // create animals Landmark: pack Animals.
@ -709,7 +709,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
{ {
_AnimalLM[i]->setParent(this); _AnimalLM[i]->setParent(this);
addCtrl(_AnimalLM[i]); addCtrl(_AnimalLM[i]);
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uiPATitleMount%d", i+1)).toUtf8()); _AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uiPATitleMount%d", i+1)));
} }
} }
@ -722,7 +722,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
{ {
_TeammateLM[i]->setParent(this); _TeammateLM[i]->setParent(this);
addCtrl(_TeammateLM[i]); addCtrl(_TeammateLM[i]);
_TeammateLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uittLMTeam%d",i)).toUtf8()); _TeammateLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uittLMTeam%d",i)));
} }
} }
} }
@ -1201,7 +1201,7 @@ void CGroupMap::checkCoords()
CEntityCL *sel = EntitiesMngr.entity(UserEntity->selection()); CEntityCL *sel = EntitiesMngr.entity(UserEntity->selection());
if (sel) if (sel)
{ {
_TargetLM->setDefaultContextHelp(NLMISC::CI18N::get("uiTargetTwoPoint").toUtf8() + sel->removeTitleAndShardFromName(sel->getEntityName()).toUtf8()); _TargetLM->setDefaultContextHelp(NLMISC::CI18N::get("uiTargetTwoPoint") + sel->removeTitleAndShardFromName(sel->getEntityName()).toUtf8());
} }
} }
} }
@ -1374,7 +1374,7 @@ void CGroupMap::checkCoords()
case ANIMAL_TYPE::Packer: sPrefix = "uiPATitlePacker"; break; case ANIMAL_TYPE::Packer: sPrefix = "uiPATitlePacker"; break;
case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break; case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break;
} }
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1)).toUtf8()); _AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1)));
} }
} }
} }

@ -837,13 +837,13 @@ class CAHGuildSheetOpen : public IActionHandler
if (pViewGrade != NULL) if (pViewGrade != NULL)
{ {
if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Leader) if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Leader)
pViewGrade->setText (CI18N::get("uiGuildLeader").toUtf8()); pViewGrade->setText (CI18N::get("uiGuildLeader"));
else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::HighOfficer) else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::HighOfficer)
pViewGrade->setText (CI18N::get("uiGuildHighOfficer").toUtf8()); pViewGrade->setText (CI18N::get("uiGuildHighOfficer"));
else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Officer) else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Officer)
pViewGrade->setText (CI18N::get("uiGuildOfficer").toUtf8()); pViewGrade->setText (CI18N::get("uiGuildOfficer"));
else else
pViewGrade->setText (CI18N::get("uiGuildMember").toUtf8()); pViewGrade->setText (CI18N::get("uiGuildMember"));
} }
// online? // online?
@ -857,17 +857,17 @@ class CAHGuildSheetOpen : public IActionHandler
case ccs_online: case ccs_online:
onlineView->setTexture("w_online.tga"); onlineView->setTexture("w_online.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline"));
break; break;
case ccs_online_abroad: case ccs_online_abroad:
onlineView->setTexture("w_online_abroad.tga"); onlineView->setTexture("w_online_abroad.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad"));
break; break;
default: default:
onlineView->setTexture("w_offline.tga"); onlineView->setTexture("w_offline.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOffline").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOffline"));
break; break;
} }
} }

@ -1535,8 +1535,8 @@ void CInterfaceManager::updateFrameEvents()
CCtrlBase *pTooltip= dynamic_cast<CCtrlBase*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather_tt")); CCtrlBase *pTooltip= dynamic_cast<CCtrlBase*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather_tt"));
if (pTooltip != NULL) if (pTooltip != NULL)
{ {
string tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour").toUtf8() + string tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour") +
" - " + CI18N::get("uiHumidity").toUtf8() + " " + " - " + CI18N::get("uiHumidity") + " " +
toString("%d", (uint)(roundWeatherValue(WeatherManager.getNextWeatherValue()) * 100.f)) + "%"; toString("%d", (uint)(roundWeatherValue(WeatherManager.getNextWeatherValue()) * 100.f)) + "%";
pTooltip->setDefaultContextHelp(tt); pTooltip->setDefaultContextHelp(tt);
} }
@ -4040,11 +4040,11 @@ char* CInterfaceManager::getTimestampHuman(const char* format /* "[%H:%M:%S] " *
* *
* All \d's in default parameter remove a following character. * All \d's in default parameter remove a following character.
*/ */
bool CInterfaceManager::parseTokens(ucstring& ucstr) bool CInterfaceManager::parseTokens(string& ucstr)
{ {
ucstring str = ucstr; string str = ucstr;
ucstring start_token("$"); string start_token("$");
ucstring end_token("$"); string end_token("$");
size_t start_pos = 0; size_t start_pos = 0;
size_t end_pos = 1; size_t end_pos = 1;
@ -4061,8 +4061,8 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
// Get the whole token substring first // Get the whole token substring first
end_pos = str.find(end_token, start_pos + 1); end_pos = str.find(end_token, start_pos + 1);
if ((start_pos == ucstring::npos) || if ((start_pos == string::npos) ||
(end_pos == ucstring::npos) || (end_pos == string::npos) ||
(end_pos <= start_pos + 1)) (end_pos <= start_pos + 1))
{ {
// Wrong formatting; give up on this one. // Wrong formatting; give up on this one.
@ -4080,19 +4080,19 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
continue; continue;
} }
ucstring token_whole = str.luabind_substr(start_pos, end_pos - start_pos + 1); string token_whole = str.substr(start_pos, end_pos - start_pos + 1);
ucstring token_string = token_whole.luabind_substr(1, token_whole.length() - 2); string token_string = token_whole.substr(1, token_whole.length() - 2);
ucstring token_replacement = token_whole; string token_replacement = token_whole;
ucstring token_default = token_whole; string token_default = token_whole;
ucstring token_subject; string token_subject;
ucstring token_param; string token_param;
// Does the token have a parameter? // Does the token have a parameter?
// If not it is 'name' by default // If not it is 'name' by default
vector<ucstring> token_vector; vector<string> token_vector;
vector<ucstring> param_vector; vector<string> param_vector;
splitUCString(token_string, ucstring("."), token_vector); splitString(token_string, ".", token_vector);
if (token_vector.empty()) if (token_vector.empty())
{ {
// Wrong formatting; give up on this one. // Wrong formatting; give up on this one.
@ -4102,23 +4102,23 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
token_subject = token_vector[0]; token_subject = token_vector[0];
if (token_vector.size() == 1) if (token_vector.size() == 1)
{ {
splitUCString(token_subject, ucstring("/"), param_vector); splitString(token_subject, "/", param_vector);
token_subject = !param_vector.empty() ? param_vector[0] : ucstring(""); token_subject = !param_vector.empty() ? param_vector[0] : string();
token_param = ucstring("name"); token_param = string("name");
} }
else if (token_vector.size() > 1) else if (token_vector.size() > 1)
{ {
token_param = token_vector[1]; token_param = token_vector[1];
if (token_param.luabind_substr(0, 3) != ucstring("gs(")) if (token_param.substr(0, 3) != "gs(")
{ {
splitUCString(token_vector[1], ucstring("/"), param_vector); splitString(token_vector[1], "/", param_vector);
token_param = !param_vector.empty() ? param_vector[0] : ucstring(""); token_param = !param_vector.empty() ? param_vector[0] : string();
} }
} }
// Get any default value, if not gs // Get any default value, if not gs
sint extra_replacement = 0; sint extra_replacement = 0;
if (token_param.luabind_substr(0, 3) != ucstring("gs(")) if (token_param.substr(0, 3) != "gs(")
{ {
if (param_vector.size() == 2) if (param_vector.size() == 2)
{ {
@ -4126,9 +4126,9 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
token_replacement = param_vector[1]; token_replacement = param_vector[1];
// Delete following chars for every '\d' in default // Delete following chars for every '\d' in default
string::size_type token_replacement_pos; string::size_type token_replacement_pos;
while ((token_replacement_pos = token_replacement.find(ucstring("\\d"))) != string::npos) while ((token_replacement_pos = token_replacement.find(string("\\d"))) != string::npos)
{ {
token_replacement.replace(token_replacement_pos, 2, ucstring("")); token_replacement.replace(token_replacement_pos, 2, string());
extra_replacement++; extra_replacement++;
} }
token_default = token_replacement; token_default = token_replacement;
@ -4137,17 +4137,17 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
CEntityCL *pTokenSubjectEntity = NULL; CEntityCL *pTokenSubjectEntity = NULL;
if (token_subject == ucstring("me")) if (token_subject == "me")
{ {
pTokenSubjectEntity = static_cast<CEntityCL*>(UserEntity); pTokenSubjectEntity = static_cast<CEntityCL*>(UserEntity);
} }
else if (token_subject == ucstring("t")) else if (token_subject == "t")
{ {
// Target // Target
uint targetSlot = UserEntity->targetSlot(); uint targetSlot = UserEntity->targetSlot();
pTokenSubjectEntity = EntitiesMngr.entity(targetSlot); pTokenSubjectEntity = EntitiesMngr.entity(targetSlot);
} }
else if (token_subject == ucstring("tt")) else if (token_subject == "tt")
{ {
// Target's target // Target's target
uint targetSlot = UserEntity->targetSlot(); uint targetSlot = UserEntity->targetSlot();
@ -4165,11 +4165,11 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
} }
} }
else if ((token_subject.length() == 3) && else if ((token_subject.length() == 3) &&
(token_subject.luabind_substr(0, 2) == ucstring("tm"))) (token_subject.substr(0, 2) == "tm"))
{ {
// Teammate // Teammate
uint indexInTeam = 0; uint indexInTeam = 0;
fromString(token_subject.luabind_substr(2, 1).toString(), indexInTeam); fromString(token_subject.substr(2, 1), indexInTeam);
// Make 0-based // Make 0-based
--indexInTeam; --indexInTeam;
@ -4205,22 +4205,22 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
if (pTokenSubjectEntity != NULL) if (pTokenSubjectEntity != NULL)
{ {
// Parse the parameter // Parse the parameter
if (token_param == ucstring("name")) if (token_param == "name")
{ {
ucstring name = pTokenSubjectEntity->getDisplayName(); string name = pTokenSubjectEntity->getDisplayName().toUtf8();
// special case where there is only a title, very rare case for some NPC // special case where there is only a title, very rare case for some NPC
if (name.empty()) if (name.empty())
{ {
name = pTokenSubjectEntity->getTitle(); name = pTokenSubjectEntity->getTitle().toUtf8();
} }
token_replacement = name.empty() ? token_replacement : name; token_replacement = name.empty() ? token_replacement : name;
} }
else if (token_param == ucstring("title")) else if (token_param == "title")
{ {
ucstring title = pTokenSubjectEntity->getTitle(); string title = pTokenSubjectEntity->getTitle().toUtf8();
token_replacement = title.empty() ? token_replacement : title; token_replacement = title.empty() ? token_replacement : title;
} }
else if (token_param == ucstring("race")) else if (token_param == "race")
{ {
CCharacterCL *pC = dynamic_cast<CCharacterCL*>(pTokenSubjectEntity); CCharacterCL *pC = dynamic_cast<CCharacterCL*>(pTokenSubjectEntity);
if (pC) if (pC)
@ -4228,27 +4228,27 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
EGSPD::CPeople::TPeople race = pC->people(); EGSPD::CPeople::TPeople race = pC->people();
if (race >= EGSPD::CPeople::Playable && race <= EGSPD::CPeople::EndPlayable) if (race >= EGSPD::CPeople::Playable && race <= EGSPD::CPeople::EndPlayable)
{ {
ucstring srace = NLMISC::CI18N::get("io" + EGSPD::CPeople::toString(race)); string srace = NLMISC::CI18N::get("io" + EGSPD::CPeople::toString(race));
token_replacement = srace.empty() ? token_replacement : srace; token_replacement = srace.empty() ? token_replacement : srace;
} }
} }
} }
else if (token_param == ucstring("guild")) else if (token_param == "guild")
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring ucGuildName; ucstring ucGuildName;
if (pSMC->getString(pTokenSubjectEntity->getGuildNameID(), ucGuildName)) if (pSMC->getString(pTokenSubjectEntity->getGuildNameID(), ucGuildName))
{ {
token_replacement = ucGuildName.empty() ? token_replacement : ucGuildName; token_replacement = ucGuildName.empty() ? token_replacement : ucGuildName.toUtf8();
} }
} }
else if (token_param.luabind_substr(0, 3) == ucstring("gs(") && else if (token_param.substr(0, 3) == "gs(" &&
token_param.luabind_substr(token_param.length() - 1 , 1) == ucstring(")")) token_param.substr(token_param.length() - 1 , 1) == ")")
{ {
// Gender string // Gender string
vector<ucstring> strList; vector<string> strList;
ucstring gender_string = token_param.luabind_substr(3, token_param.length() - 4); string gender_string = token_param.substr(3, token_param.length() - 4);
splitUCString(gender_string, ucstring("/"), strList); splitString(gender_string, "/", strList);
if (strList.size() <= 1) if (strList.size() <= 1)
{ {
@ -4277,8 +4277,8 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
{ {
// Nothing to replace; show message and exit // Nothing to replace; show message and exit
CInterfaceManager *im = CInterfaceManager::getInstance(); CInterfaceManager *im = CInterfaceManager::getInstance();
ucstring message = ucstring(CI18N::get("uiUntranslatedToken")); string message = CI18N::get("uiUntranslatedToken");
message.replace(message.find(ucstring("%s")), 2, token_whole); message.replace(message.find("%s"), 2, token_whole);
im->displaySystemInfo(message); im->displaySystemInfo(message);
return false; return false;
} }

@ -448,7 +448,7 @@ public:
/** Parses any tokens in the ucstring like $t$ or $g()$ /** Parses any tokens in the ucstring like $t$ or $g()$
*/ */
static bool parseTokens(ucstring& ucstr); static bool parseTokens(std::string& ucstr);
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
private: private:

@ -1050,7 +1050,7 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls)
// Create a line // Create a line
pMenu->addLine(CI18N::get(sTmp), "lua", pMenu->addLine(CI18N::get(sTmp), "lua",
luaParams + "('" + sEmoteId + "', '" + toString(CI18N::get(sTmp)) + "')", sTmp); luaParams + "('" + sEmoteId + "', '" + toString(CI18N::get(sTmp)) + "')", sTmp);
emoteList[sEmoteId] = (toLower(CI18N::get(sTmp))).toUtf8(); emoteList[sEmoteId] = (toLower(CI18N::get(sTmp)));
} }
} }
@ -3629,7 +3629,7 @@ void CLuaIHMRyzom::tell(const ucstring &player, const ucstring &msg)
if (!msg.empty()) if (!msg.empty())
{ {
// Parse any tokens in the message. // Parse any tokens in the message.
ucstring msg_modified = msg; string msg_modified = msg.toUtf8();
// Parse any tokens in the text // Parse any tokens in the text
if (! CInterfaceManager::parseTokens(msg_modified)) if (! CInterfaceManager::parseTokens(msg_modified))

@ -492,7 +492,7 @@ void CModalContainerEditCmd::activate()
} }
if (found) if (found)
{ {
pCB->addText(CI18N::get(rVCat[i].LocalizedName).toUtf8()); pCB->addText(CI18N::get(rVCat[i].LocalizedName));
CurrentEditCmdCategories.push_back(rVCat[i].Name); CurrentEditCmdCategories.push_back(rVCat[i].Name);
} }
} }
@ -689,7 +689,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std
if (noParam == 0) sText = WinName+VIEW_EDITCMD_FIRST_PARAM_NAME; if (noParam == 0) sText = WinName+VIEW_EDITCMD_FIRST_PARAM_NAME;
else sText = WinName+VIEW_EDITCMD_SECOND_PARAM_NAME; else sText = WinName+VIEW_EDITCMD_SECOND_PARAM_NAME;
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(sText)); CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(sText));
if (pVT != NULL) pVT->setText(CI18N::get(pBA->Parameters[i].LocalizedName).toUtf8()); if (pVT != NULL) pVT->setText(CI18N::get(pBA->Parameters[i].LocalizedName));
noParam++; noParam++;
} }
} }
@ -778,7 +778,7 @@ void CModalContainerEditCmd::invalidCurrentCommand()
{ {
// Dont display key shortcut if we are in creation mode // Dont display key shortcut if we are in creation mode
pVT= dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId( WinName+VIEW_EDITCMD_TEXT_KEY )); pVT= dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId( WinName+VIEW_EDITCMD_TEXT_KEY ));
if (pVT != NULL) pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); if (pVT != NULL) pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT));
// Deactivate the key definer text // Deactivate the key definer text
pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY));
@ -897,7 +897,7 @@ void CModalContainerEditCmd::validCurrentCommand()
CurrentEditCmdLine.Combo.Key = KeyCount; CurrentEditCmdLine.Combo.Key = KeyCount;
CurrentEditCmdLine.Combo.KeyButtons = noKeyButton; CurrentEditCmdLine.Combo.KeyButtons = noKeyButton;
// Display not assigned text // Display not assigned text
pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT));
// Do not display the ok button // Do not display the ok button
CCtrlBaseButton *pCB = dynamic_cast<CCtrlBaseButton*>(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); CCtrlBaseButton *pCB = dynamic_cast<CCtrlBaseButton*>(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK));
if (pCB != NULL) pCB->setFrozen (true); if (pCB != NULL) pCB->setFrozen (true);
@ -1033,7 +1033,7 @@ void CModalContainerEditCmd::onChangeCategory()
{ {
if (rBA.isUsableInCurrentContext()) if (rBA.isUsableInCurrentContext())
{ {
pCB->addText(CI18N::get(rBA.LocalizedName).toUtf8()); pCB->addText(CI18N::get(rBA.LocalizedName));
} }
} }
} }
@ -1111,7 +1111,7 @@ void CModalContainerEditCmd::onChangeAction()
pViewParamName = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(sViewText)); pViewParamName = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(sViewText));
if (pViewParamName != NULL) if (pViewParamName != NULL)
pViewParamName->setText (CI18N::get(rP.LocalizedName).toUtf8()); pViewParamName->setText (CI18N::get(rP.LocalizedName));
} }
if (rP.Type == CBaseAction::CParameter::Constant) if (rP.Type == CBaseAction::CParameter::Constant)
@ -1131,7 +1131,7 @@ void CModalContainerEditCmd::onChangeAction()
if (ActionsContext.matchContext(rVal.Contexts)) if (ActionsContext.matchContext(rVal.Contexts))
{ {
if (NLMISC::startsWith(rVal.LocalizedValue, "ui")) if (NLMISC::startsWith(rVal.LocalizedValue, "ui"))
pCB->addText(CI18N::get(rVal.LocalizedValue).toUtf8()); pCB->addText(CI18N::get(rVal.LocalizedValue));
else else
pCB->addText(rVal.LocalizedValue); pCB->addText(rVal.LocalizedValue);
} }

@ -895,7 +895,7 @@ public:
if (pVT != NULL) if (pVT != NULL)
{ {
if (pMCM->CurrentEditMacro.Combo.Key == KeyCount) if (pMCM->CurrentEditMacro.Combo.Key == KeyCount)
pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT));
else else
pVT->setText(pMCM->CurrentEditMacro.Combo.toUCString().toUtf8()); pVT->setText(pMCM->CurrentEditMacro.Combo.toUCString().toUtf8());
} }
@ -1005,7 +1005,7 @@ void addMacroLine (CGroupList *pParent, uint macNb, const CMacroCmd &macro)
if (macro.Combo.Key != KeyCount) if (macro.Combo.Key != KeyCount)
pVT->setText(macro.Combo.toUCString().toUtf8()); pVT->setText(macro.Combo.toUCString().toUtf8());
else else
pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT));
} }
pNewMacro->setParent (pParent); pNewMacro->setParent (pParent);

@ -492,7 +492,7 @@ void CMusicPlayer::clearPlayingInfo()
{ {
if (_Songs.empty()) if (_Songs.empty())
{ {
updatePlayingInfo(CI18N::get("uiNoFiles").toUtf8()); updatePlayingInfo(CI18N::get("uiNoFiles"));
} }
else else
{ {
@ -632,7 +632,7 @@ void CMusicPlayer::createPlaylistFromMusic()
join(extensions, ", ", extlist); join(extensions, ", ", extlist);
extlist += ", m3u, m3u8"; extlist += ", m3u, m3u8";
std::string msg(CI18N::get("uiMk_system6").toUtf8()); std::string msg(CI18N::get("uiMk_system6"));
msg += ": " + newPath + " (" + extlist + ")"; msg += ": " + newPath + " (" + extlist + ")";
CInterfaceManager::getInstance()->displaySystemInfo(ucstring::makeFromUtf8(msg), "SYS"); CInterfaceManager::getInstance()->displaySystemInfo(ucstring::makeFromUtf8(msg), "SYS");
nlinfo("%s", msg.c_str()); nlinfo("%s", msg.c_str());

@ -471,14 +471,14 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c
return; return;
} }
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); string csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "";
ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg; string finalMsg = csr + CI18N::get("youTell") + ": " + msg.toUtf8();
// display msg with good color // display msg with good color
CInterfaceProperty prop; CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
ucstring s = CI18N::get("youTellPlayer"); string s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver); strFindReplace(s, "%name", receiver.toUtf8());
strFindReplace(finalMsg, CI18N::get("youTell"), s); strFindReplace(finalMsg, CI18N::get("youTell"), s);
gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA()));
CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell));
@ -759,17 +759,17 @@ void CPeopleList::setOnline(uint index, TCharConnectionState online)
case ccs_online: case ccs_online:
onlineView->setTexture("w_online.tga"); onlineView->setTexture("w_online.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnline").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnline"));
break; break;
case ccs_online_abroad: case ccs_online_abroad:
onlineView->setTexture("w_online_abroad.tga"); onlineView->setTexture("w_online_abroad.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnlineAbroad").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnlineAbroad"));
break; break;
default: default:
onlineView->setTexture("w_offline.tga"); onlineView->setTexture("w_offline.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOffline").toUtf8()); toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOffline"));
break; break;
} }
} }
@ -876,7 +876,7 @@ class CHandlerContactEntry : public IActionHandler
{ {
CGroupEditBox *pEB = dynamic_cast<CGroupEditBox*>(pCaller); CGroupEditBox *pEB = dynamic_cast<CGroupEditBox*>(pCaller);
if (pEB == NULL) return; if (pEB == NULL) return;
ucstring text = pEB->getInputStringAsUtf16(); string text = pEB->getInputString();
// If the line is empty, do nothing // If the line is empty, do nothing
if(text.empty()) if(text.empty())
return; return;
@ -892,8 +892,7 @@ class CHandlerContactEntry : public IActionHandler
if(text[0] == '/') if(text[0] == '/')
{ {
CChatWindow::_ChatWindowLaunchingCommand = NULL; // no CChatWindow instance there .. CChatWindow::_ChatWindowLaunchingCommand = NULL; // no CChatWindow instance there ..
// TODO : have NLMISC::ICommand accept unicode strings std::string str = text.substr(1);
std::string str = text.toUtf8().substr(1);
NLMISC::ICommand::execute( str, g_log ); NLMISC::ICommand::execute( str, g_log );
pEB->setInputString (std::string()); pEB->setInputString (std::string());
return; return;
@ -904,10 +903,10 @@ class CHandlerContactEntry : public IActionHandler
CGroupContainer *gc = static_cast< CGroupContainer* >( pCaller->getParent()->getEnclosingContainer() ); CGroupContainer *gc = static_cast< CGroupContainer* >( pCaller->getParent()->getEnclosingContainer() );
// title gives the name of the player // title gives the name of the player
ucstring playerName = gc->getUCTitle(); string playerName = gc->getUCTitle().toUtf8();
// Simply do a tell on the player // Simply do a tell on the player
ChatMngr.tell(playerName.toString(), text); ChatMngr.tell(playerName, text);
pEB->setInputString (std::string()); pEB->setInputString (std::string());
if (gc) if (gc)
{ {
@ -940,18 +939,18 @@ class CHandlerContactEntry : public IActionHandler
CChatGroupWindow *pWin = PeopleInterraction.getChatGroupWindow(); CChatGroupWindow *pWin = PeopleInterraction.getChatGroupWindow();
CInterfaceProperty prop; CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
ucstring final; string final;
CChatWindow::encodeColorTag(prop.getRGBA(), final, false); CChatWindow::encodeColorTag(prop.getRGBA(), final, false);
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); string csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
final += csr + CI18N::get("youTell")+": "; final += csr + CI18N::get("youTell")+": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), final, true); CChatWindow::encodeColorTag(prop.getRGBA(), final, true);
final += text; final += text;
pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str)); pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str));
ucstring s = CI18N::get("youTellPlayer"); string s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", pWin->getFreeTellerName(str)); strFindReplace(s, "%name", pWin->getFreeTellerName(str).toUtf8());
strFindReplace(final, CI18N::get("youTell"), s); strFindReplace(final, CI18N::get("youTell"), s);
CInterfaceManager::getInstance()->log(final, CChatGroup::groupTypeToString(CChatGroup::tell)); CInterfaceManager::getInstance()->log(final, CChatGroup::groupTypeToString(CChatGroup::tell));
} }

@ -588,7 +588,7 @@ void CSkillManager::checkTitleUnblocked(CHARACTER_TITLE::ECharacterTitle i, bool
string titleStr = CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)i); string titleStr = CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)i);
bool womenTitle = (UserEntity && UserEntity->getGender() == GSGENDER::female); bool womenTitle = (UserEntity && UserEntity->getGender() == GSGENDER::female);
const ucstring newtitle(CStringManagerClient::getTitleLocalizedName(titleStr, womenTitle)); const ucstring newtitle(CStringManagerClient::getTitleLocalizedName(titleStr, womenTitle));
CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+newtitle.toUtf8()+"|text0="+CI18N::get("uiNewTitleBold").toUtf8()); CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+newtitle.toUtf8()+"|text0="+CI18N::get("uiNewTitleBold"));
} }
else else
{ {

@ -182,7 +182,7 @@ public:
if (it != acmap.end()) if (it != acmap.end())
pVT->setText(it->second.toUCString().toUtf8()); pVT->setText(it->second.toUCString().toUtf8());
else else
pVT->setText(CI18N::get("uiNotAssigned").toUtf8()); pVT->setText(CI18N::get("uiNotAssigned"));
} }
} }
} }

@ -1931,9 +1931,9 @@ int CPatchManager::validateProgress(void *foo, double t, double d, double /* ult
if (units.empty()) if (units.empty())
{ {
units.push_back(CI18N::get("uiByte").toUtf8()); units.push_back(CI18N::get("uiByte"));
units.push_back(CI18N::get("uiKb").toUtf8()); units.push_back(CI18N::get("uiKb"));
units.push_back(CI18N::get("uiMb").toUtf8()); units.push_back(CI18N::get("uiMb"));
} }
CPatchManager *pPM = CPatchManager::getInstance(); CPatchManager *pPM = CPatchManager::getInstance();

@ -716,7 +716,7 @@ static std::string getActionKey(const char* name, const char* param = "")
if (ite != acmap.end()) if (ite != acmap.end())
return ite->second.toUCString().toString(); return ite->second.toUCString().toString();
return CI18N::get("uiNotAssigned").toString(); return CI18N::get("uiNotAssigned");
} }
//--------------------------------------------------- //---------------------------------------------------

@ -614,23 +614,23 @@ static CInterfaceChatDisplayer InterfaceChatDisplayer;
void CInterfaceChatDisplayer::colorizeSender(ucstring &text, const ucstring &senderName, CRGBA baseColor) void CInterfaceChatDisplayer::colorizeSender(ucstring &text, const ucstring &senderName, CRGBA baseColor)
{ {
// find the sender/text separator to put color tags // find the sender/text separator to put color tags
ucstring::size_type pos = senderName.length() - 1; ucstring::size_type pos = senderName.toUtf8().length() - 1;
if (pos != ucstring::npos) if (pos != ucstring::npos)
{ {
ucstring str; string str;
CInterfaceProperty prop; CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), str, false); CChatWindow::encodeColorTag(prop.getRGBA(), str, false);
str += text.substr(0, pos+1); str += text.toUtf8().substr(0, pos+1);
CChatWindow::encodeColorTag(baseColor, str, true); CChatWindow::encodeColorTag(baseColor, str, true);
str += text.substr(pos+1); str += text.toUtf8().substr(pos+1);
text.swap(str); text.fromUtf8(str);
} }
} }

@ -354,12 +354,12 @@ void CProgress::internalProgress (float value)
// Print some more info // Print some more info
uint32 day = RT.getRyzomDay(); uint32 day = RT.getRyzomDay();
str = toString (CI18N::get ("uiTipsTeleport").toUtf8().c_str(), str = toString (CI18N::get ("uiTipsTeleport").c_str(),
CI18N::get (LoadingContinent->LocalizedName).toUtf8().c_str(), CI18N::get (LoadingContinent->LocalizedName).c_str(),
day, day,
(uint)RT.getRyzomTime(), (uint)RT.getRyzomTime(),
CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).toUtf8().c_str(), CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).c_str(),
CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).toUtf8().c_str()); CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).c_str());
ucstring ucstr; ucstring ucstr;
ucstr.fromUtf8 (str); ucstr.fromUtf8 (str);
TextContext->setHotSpot(UTextContext::MiddleBottom); TextContext->setHotSpot(UTextContext::MiddleBottom);

@ -281,7 +281,7 @@ void CAutoGroup::group(CObject *newEntityDesc, const NLMISC::CVectorD &createPos
R2::getEditor().getEnv()["PaletteIdToGroupTranslation"][newEntityDesc->getAttr("Base")->toString()].push(); R2::getEditor().getEnv()["PaletteIdToGroupTranslation"][newEntityDesc->getAttr("Base")->toString()].push();
if (ls.isString(-1)) if (ls.isString(-1))
readableName.fromUtf8(ls.toString(-1)); readableName.fromUtf8(ls.toString(-1));
ucstring ucGroupName = ucstring(readableName + " " + CI18N::get("uiR2EDNameGroup").toUtf8()); ucstring ucGroupName = ucstring(readableName + " " + CI18N::get("uiR2EDNameGroup"));
newGroup->set("Name", getEditor().genInstanceName(ucGroupName).toUtf8()); newGroup->set("Name", getEditor().genInstanceName(ucGroupName).toUtf8());
getEditor().getDMC().requestInsertNode(destGroup->getParentAct()->getId(), getEditor().getDMC().requestInsertNode(destGroup->getParentAct()->getId(),

@ -994,7 +994,7 @@ void CDisplayerVisualEntity::updateName()
} }
std::string firstPart; std::string firstPart;
if(actNb>0) if(actNb>0)
firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb); firstPart = CI18N::get("uiR2EDDefaultActTitle") + " " + NLMISC::toString(actNb);
if (act->isString("Name")) if (act->isString("Name"))
actName = act->toString("Name"); actName = act->toString("Name");
@ -1006,7 +1006,7 @@ void CDisplayerVisualEntity::updateName()
} }
else else
{ {
actName = CI18N::get("uiR2EDBaseAct").toString(); actName = CI18N::get("uiR2EDBaseAct");
} }
actName = NLMISC::toString(" [%s]", actName.c_str()); actName = NLMISC::toString(" [%s]", actName.c_str());

@ -76,7 +76,7 @@ public:
virtual void getContextHelp(std::string &help) const virtual void getContextHelp(std::string &help) const
{ {
help = Instance.getDisplayName().toUtf8(); help = Instance.getDisplayName().toUtf8();
if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8()) if (help == NLMISC::CI18N::get("uiR2EDNoName"))
help.clear(); help.clear();
} }
bool emptyContextHelp() const { return true; } bool emptyContextHelp() const { return true; }
@ -125,7 +125,7 @@ public:
virtual void getContextHelp(std::string &help) const virtual void getContextHelp(std::string &help) const
{ {
help = Instance.getDisplayName().toUtf8(); help = Instance.getDisplayName().toUtf8();
if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8()) if (help == NLMISC::CI18N::get("uiR2EDNoName"))
help.clear(); help.clear();
} }
bool emptyContextHelp() const { return true; } bool emptyContextHelp() const { return true; }

@ -1761,7 +1761,7 @@ void CEditor::waitScenarioScreen()
// Display the firewall alert string // Display the firewall alert string
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting:title")); CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting:title"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiFirewallAlert").toUtf8()+"..."); pVT->setText(CI18N::get("uiFirewallAlert")+"...");
// The mouse and fullscreen mode should be unlocked for the user to set the firewall permission // The mouse and fullscreen mode should be unlocked for the user to set the firewall permission
nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts
@ -1853,8 +1853,8 @@ void CEditor::waitScenarioScreen()
if (pVT != NULL) if (pVT != NULL)
{ {
pVT->setMultiLine( true ); pVT->setMultiLine( true );
pVT->setText(CI18N::get("uiFirewallFail").toUtf8()+".\n"+ pVT->setText(CI18N::get("uiFirewallFail")+".\n"+
CI18N::get("uiFirewallAlert").toUtf8()+"."); CI18N::get("uiFirewallAlert")+".");
} }
} }
} }
@ -6468,7 +6468,7 @@ void CEditor::connectionMsg(const std::string &stringId)
CViewText *vt = dynamic_cast<CViewText *>(r2ConnectWindow->getView("connexionMsg")); CViewText *vt = dynamic_cast<CViewText *>(r2ConnectWindow->getView("connexionMsg"));
if (vt) if (vt)
{ {
vt->setText(CI18N::get(stringId).toUtf8()); vt->setText(CI18N::get(stringId));
} }
} }
} }
@ -7497,7 +7497,7 @@ class CAHInviteCharacter : public IActionHandler
{ {
CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial").toUtf8()); pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial"));
CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial");
} }

@ -44,7 +44,7 @@ void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(std::string &help) cons
{ {
//H_AUTO(R2_CCtrlButtonEntity_getContextHelp) //H_AUTO(R2_CCtrlButtonEntity_getContextHelp)
help = _Instance.getDisplayName().toUtf8(); help = _Instance.getDisplayName().toUtf8();
if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8()) if (help == NLMISC::CI18N::get("uiR2EDNoName"))
help.clear(); help.clear();
} }

@ -417,9 +417,9 @@ void CToolSelectMove::commitAction(CInstance &instance)
} }
else else
{ {
ucstring instanceName = instance.getDisplayName(); string instanceName = instance.getDisplayName().toUtf8();
if(instanceName == CI18N::get("uiR2EDNoName")) if(instanceName == CI18N::get("uiR2EDNoName"))
instanceName = ucstring(instance.getClassName()); instanceName = instance.getClassName();
//getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instance.getDisplayName()); //getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instance.getDisplayName());
getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instanceName); getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instanceName);

@ -230,7 +230,7 @@ int CSessionBrowserImpl::luaJoinRingSession(CLuaState &ls)
{ {
CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); CViewText* pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text"));
if (pVT != NULL) if (pVT != NULL)
pVT->setText(CI18N::get("uiRingWarningFreeTrial").toUtf8()); pVT->setText(CI18N::get("uiRingWarningFreeTrial"));
CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:warning_free_trial"); CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:warning_free_trial");
} }

@ -118,7 +118,7 @@ namespace RM_FABER_TYPE
} }
/// Client: use the CI18N /// Client: use the CI18N
const ucstring& toLocalString( TRMFType e ) const std::string& toLocalString( TRMFType e )
{ {
return CI18N::get("mpft" + toString(e)); return CI18N::get("mpft" + toString(e));
} }
@ -134,7 +134,7 @@ namespace RM_FABER_TYPE
namespace RM_FAMILY namespace RM_FAMILY
{ {
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMFamily e ) const std::string& toLocalString( TRMFamily e )
{ {
return CI18N::get("mpfam" + toString(e)); return CI18N::get("mpfam" + toString(e));
} }
@ -144,7 +144,7 @@ namespace RM_FAMILY
namespace RM_GROUP namespace RM_GROUP
{ {
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMGroup e ) const std::string& toLocalString( TRMGroup e )
{ {
return CI18N::get("mpgroup" + toString(e)); return CI18N::get("mpgroup" + toString(e));
} }
@ -154,7 +154,7 @@ namespace RM_GROUP
namespace RM_FABER_PROPERTY namespace RM_FABER_PROPERTY
{ {
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMFProperty e ) const std::string& toLocalString( TRMFProperty e )
{ {
return CI18N::get("mpprop" + toString(e)); return CI18N::get("mpprop" + toString(e));
} }
@ -188,7 +188,7 @@ namespace RM_FABER_QUALITY
} }
/// Client: use the CI18N /// Client: use the CI18N
const ucstring& toLocalString( TFaberQuality e ) const std::string& toLocalString( TFaberQuality e )
{ {
return CI18N::get("mpfq" + toString(e)); return CI18N::get("mpfq" + toString(e));
} }
@ -224,7 +224,7 @@ namespace RM_COLOR
} }
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( sint value ) const std::string& toLocalString( sint value )
{ {
return CI18N::get("mpcol" + toString(value)); return CI18N::get("mpcol" + toString(value));
} }
@ -283,7 +283,7 @@ namespace RM_FABER_STAT_TYPE
return conversion.toString(stats); return conversion.toString(stats);
} }
const ucstring& toLocalString( TRMStatType stats ) const std::string& toLocalString( TRMStatType stats )
{ {
// must change en.uxt // must change en.uxt
nlctassert(NumRMStatType == sizeof(stringTable)/sizeof(stringTable[0])); nlctassert(NumRMStatType == sizeof(stringTable)/sizeof(stringTable[0]));
@ -663,9 +663,9 @@ namespace RM_FABER_STAT_TYPE
namespace RM_CLASS_TYPE namespace RM_CLASS_TYPE
{ {
const ucstring &toLocalString(TRMClassType classType) const std::string &toLocalString(TRMClassType classType)
{ {
return CI18N::get(toString("uiItemRMClass%d", classType).c_str()); return CI18N::get(toString("uiItemRMClass%d", classType));
} }

@ -85,7 +85,7 @@ namespace RM_FABER_TYPE
const std::string &faberTypeToSheetEntry(TRMFType type); const std::string &faberTypeToSheetEntry(TRMFType type);
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMFType e ); const std::string& toLocalString( TRMFType e );
/// For Client Interface, return the define name of the type (eg: "item_part_icon_MpL") /// For Client Interface, return the define name of the type (eg: "item_part_icon_MpL")
std::string toIconDefineString( TRMFType e ); std::string toIconDefineString( TRMFType e );
@ -101,7 +101,7 @@ namespace RM_FAMILY
const TRMFamily Unknown = 0; const TRMFamily Unknown = 0;
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMFamily e ); const std::string& toLocalString( TRMFamily e );
/// Debug string /// Debug string
inline std::string toString( TRMFamily e ) { return NLMISC::toString(e); } inline std::string toString( TRMFamily e ) { return NLMISC::toString(e); }
@ -119,7 +119,7 @@ namespace RM_GROUP
const TRMGroup Unknown = 0; const TRMGroup Unknown = 0;
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMGroup e ); const std::string& toLocalString( TRMGroup e );
// Note: the group names are accessible on server by CMP::rmGroupToString() // Note: the group names are accessible on server by CMP::rmGroupToString()
@ -138,7 +138,7 @@ namespace RM_FABER_PROPERTY
const TRMFProperty Unknown = 0; const TRMFProperty Unknown = 0;
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMFProperty e ); const std::string& toLocalString( TRMFProperty e );
/// Debug string /// Debug string
inline std::string toString( TRMFProperty e ) { return NLMISC::toString(e); } inline std::string toString( TRMFProperty e ) { return NLMISC::toString(e); }
@ -178,7 +178,7 @@ namespace RM_FABER_QUALITY
TFaberQuality toFaberQuality( const std::string& str ); TFaberQuality toFaberQuality( const std::string& str );
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TFaberQuality e ); const std::string& toLocalString( TFaberQuality e );
} }
@ -199,7 +199,7 @@ namespace RM_COLOR
const std::string& toString( sint value ); const std::string& toString( sint value );
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( sint value ); const std::string& toLocalString( sint value );
}; };
@ -251,7 +251,7 @@ namespace RM_FABER_STAT_TYPE
const std::string& toString( TRMStatType stats ); const std::string& toString( TRMStatType stats );
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMStatType stats ); const std::string& toLocalString( TRMStatType stats );
/// For each Raw material faber type, does this Stat is relevant? /// For each Raw material faber type, does this Stat is relevant?
bool isStatRelevant(RM_FABER_TYPE::TRMFType ft, TRMStatType fs); bool isStatRelevant(RM_FABER_TYPE::TRMFType ft, TRMStatType fs);
@ -309,7 +309,7 @@ namespace RM_CLASS_TYPE
}; };
/// Get the Localized UCString /// Get the Localized UCString
const ucstring& toLocalString( TRMClassType classType ); const std::string& toLocalString( TRMClassType classType );
/// return the item class for a given stat energy [0..100] /// return the item class for a given stat energy [0..100]
inline TRMClassType getItemClass(uint32 energy) inline TRMClassType getItemClass(uint32 energy)

@ -73,7 +73,7 @@ ERole toRoleId( const std::string& Role )
} }
// Return the Translated name of the Job // Return the Translated name of the Job
const ucstring &roleToUCString (ERole r) const std::string &roleToUCString(ERole r)
{ {
return NLMISC::CI18N::get( toString( r ) ); return NLMISC::CI18N::get( toString( r ) );
} }

@ -60,7 +60,7 @@ const std::string& toString( ERole r );
ERole toRoleId( const std::string& Role ); ERole toRoleId( const std::string& Role );
// Return the Translated name of the Job // Return the Translated name of the Job
const ucstring &roleToUCString (ERole r); const std::string &roleToUCString (ERole r);
} // ROLES } // ROLES

Loading…
Cancel
Save