diff --git a/nel/include/nel/misc/i18n.h b/nel/include/nel/misc/i18n.h index e8b00385b..28df54c5e 100644 --- a/nel/include/nel/misc/i18n.h +++ b/nel/include/nel/misc/i18n.h @@ -99,7 +99,7 @@ public: /// 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 - static const std::vector &getLanguageNames(); + static const std::vector &getLanguageNames(); /** Return a vector with all language code available. * Code are ISO 639-2 compliant. @@ -122,7 +122,7 @@ public: static void loadFromFilename (const std::string &filename, bool reload); /// 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", ...) static std::string getCurrentLanguageCode (); @@ -134,7 +134,10 @@ public: static bool setSystemLanguageCode (const std::string &languageCode); /// 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. // NB : The empty string is considered to have a translation @@ -219,24 +222,28 @@ public: private: - typedef std::map StrMapContainer; + typedef std::map StrMapContainer; + typedef std::map StrMapContainer16; static ILoadProxy *_LoadProxy; static StrMapContainer _StrMap; + static StrMapContainer16 _StrMap16; static bool _StrMapLoaded; // the alternative language that will be used if the sentence is not found in the original language static StrMapContainer _StrMapFallback; + static StrMapContainer16 _StrMapFallback16; static std::vector _LanguageCodes; - static std::vector _LanguageNames; + static std::vector _LanguageNames; static std::string _SystemLanguageCode; static bool _LanguagesNamesLoaded; static std::string _SelectedLanguageCode; - static const ucstring _NotTranslatedValue; + static const ucstring _NotTranslatedValue16; + static const std::string _NotTranslatedValue; /** Structure to hold contextual info during * read of preprocessed file @@ -256,7 +263,7 @@ private: /// Init _LanguageCodes and _LanguageNames 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 static void _readTextFile(const std::string &filename, diff --git a/nel/src/gui/ctrl_base.cpp b/nel/src/gui/ctrl_base.cpp index 75c3024f3..1f652031b 100644 --- a/nel/src/gui/ctrl_base.cpp +++ b/nel/src/gui/ctrl_base.cpp @@ -127,7 +127,7 @@ namespace NLGUI { // Force I18N tooltip if (!editorMode) - _ContextHelp = CI18N::get((const char *)prop).toUtf8(); + _ContextHelp = CI18N::get((const char *)prop); else _ContextHelp = (const char *)prop; } @@ -138,7 +138,7 @@ namespace NLGUI if (prop) { if (!editorMode && NLMISC::startsWith((const char *)prop, "ui")) - _ContextHelp = CI18N::get((const char *)prop).toUtf8(); + _ContextHelp = CI18N::get((const char *)prop); else _ContextHelp = (const char *)prop; } @@ -259,7 +259,7 @@ namespace NLGUI if( name == "tooltip" ) { if (!editorMode && NLMISC::startsWith(value, "ui")) - _ContextHelp = CI18N::get(value).toUtf8(); + _ContextHelp = CI18N::get(value); else _ContextHelp = value; return; @@ -268,7 +268,7 @@ namespace NLGUI if( name == "tooltip_i18n" ) { if (!editorMode) - _ContextHelp = CI18N::get(value).toUtf8(); + _ContextHelp = CI18N::get(value); else _ContextHelp = value; return; diff --git a/nel/src/gui/ctrl_text_button.cpp b/nel/src/gui/ctrl_text_button.cpp index 1bd32be27..154d41633 100644 --- a/nel/src/gui/ctrl_text_button.cpp +++ b/nel/src/gui/ctrl_text_button.cpp @@ -598,7 +598,7 @@ namespace NLGUI const char *propPtr = prop; std::string text; if (NLMISC::startsWith(propPtr, "ui")) - text = CI18N::get(propPtr).toUtf8(); + text = CI18N::get(propPtr); else text = propPtr; _ViewText->setText(text); diff --git a/nel/src/gui/dbgroup_combo_box.cpp b/nel/src/gui/dbgroup_combo_box.cpp index 6cf911399..66d3220a0 100644 --- a/nel/src/gui/dbgroup_combo_box.cpp +++ b/nel/src/gui/dbgroup_combo_box.cpp @@ -184,7 +184,7 @@ namespace NLGUI { const char *propPtr = name; if (NLMISC::startsWith(propPtr, "ui")) - addText(CI18N::get(propPtr).toUtf8()); + addText(CI18N::get(propPtr)); else addText(propPtr); } diff --git a/nel/src/gui/dbview_quantity.cpp b/nel/src/gui/dbview_quantity.cpp index 0f90d598e..192b0a936 100644 --- a/nel/src/gui/dbview_quantity.cpp +++ b/nel/src/gui/dbview_quantity.cpp @@ -148,7 +148,7 @@ namespace NLGUI { const char *propPtr = ptr; if (NLMISC::startsWith(propPtr, "ui")) - _EmptyText = CI18N::get(propPtr).toUtf8(); + _EmptyText = CI18N::get(propPtr); else _EmptyText = propPtr; } diff --git a/nel/src/gui/group_container.cpp b/nel/src/gui/group_container.cpp index f0a023c39..7bab62820 100644 --- a/nel/src/gui/group_container.cpp +++ b/nel/src/gui/group_container.cpp @@ -3538,7 +3538,7 @@ namespace NLGUI _RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popin")); _RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over")); _RightButton->setActionOnLeftClick ("ic_popin"); - _RightButton->setDefaultContextHelp(CI18N::get("uiPopinWindow").toUtf8()); + _RightButton->setDefaultContextHelp(CI18N::get("uiPopinWindow")); } else // else the container can be deactivated ? deactivate button { @@ -3546,7 +3546,7 @@ namespace NLGUI _RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_deactive")); _RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over")); _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->setTextureOver (pLayer->getValStr ("right_button_tx_over")); _RightButton->setActionOnLeftClick ("ic_popup"); - _RightButton->setDefaultContextHelp(CI18N::get("uiPopupWindow").toUtf8()); + _RightButton->setDefaultContextHelp(CI18N::get("uiPopupWindow")); } _RightButton->setActive(!_Locked); } @@ -3602,7 +3602,7 @@ namespace NLGUI _HelpButton->setTexturePushed (pLayer->getValStr ("help_button_tx")); _HelpButton->setTextureOver (pLayer->getValStr ("help_button_tx_over")); _HelpButton->setActionOnLeftClick ("ic_help"); - _HelpButton->setDefaultContextHelp(CI18N::get("uiHelp").toUtf8()); + _HelpButton->setDefaultContextHelp(CI18N::get("uiHelp")); } // if not layer 0 diff --git a/nel/src/gui/group_html.cpp b/nel/src/gui/group_html.cpp index 08bf1b7c1..15bd47a68 100644 --- a/nel/src/gui/group_html.cpp +++ b/nel/src/gui/group_html.cpp @@ -3229,7 +3229,7 @@ namespace NLGUI { if (CI18N::hasTranslation(tooltip)) { - ctrlButton->setDefaultContextHelp(CI18N::get(tooltip).toUtf8()); + ctrlButton->setDefaultContextHelp(CI18N::get(tooltip)); //ctrlButton->setOnContextHelp(CI18N::get(tooltip).toString()); } else @@ -5467,7 +5467,7 @@ namespace NLGUI { if (CI18N::hasTranslation(tooltip)) { - ctrlButton->setDefaultContextHelp(CI18N::get(tooltip).toUtf8()); + ctrlButton->setDefaultContextHelp(CI18N::get(tooltip)); } else { diff --git a/nel/src/gui/lua_ihm.cpp b/nel/src/gui/lua_ihm.cpp index cf60444a6..908898e74 100644 --- a/nel/src/gui/lua_ihm.cpp +++ b/nel/src/gui/lua_ihm.cpp @@ -1691,7 +1691,7 @@ namespace NLGUI // inside i18n table luabind::module(L, "i18n") [ - luabind::def("get", &CI18N::get), + luabind::def("get", &CI18N::getAsUtf16), // FIXME: Lua UTF-8 luabind::def("hasTranslation", &CI18N::hasTranslation) ]; // inside 'nlfile' table diff --git a/nel/src/gui/view_text.cpp b/nel/src/gui/view_text.cpp index d23d89f87..69b117330 100644 --- a/nel/src/gui/view_text.cpp +++ b/nel/src/gui/view_text.cpp @@ -653,7 +653,7 @@ namespace NLGUI #if 1 if (NLMISC::startsWith(value, "ui")) { - _Text = CI18N::get(value).toUtf8(); + _Text = CI18N::get(value); _TextLength = 0; _HardText = value; } @@ -1000,7 +1000,7 @@ namespace NLGUI if (NLMISC::startsWith(propPtr, "ui")) { _HardText = propPtr; - _Text = CI18N::get(propPtr).toUtf8(); + _Text = CI18N::get(propPtr); _TextLength = 0; } else @@ -1021,11 +1021,11 @@ namespace NLGUI if (_MultiLine) { - setTextFormatTaged(CI18N::get(propPtr).toUtf8()); + setTextFormatTaged(CI18N::get(propPtr)); } else { - setSingleLineTextFormatTaged(CI18N::get(propPtr).toUtf8()); + setSingleLineTextFormatTaged(CI18N::get(propPtr)); } } @@ -2394,7 +2394,7 @@ namespace NLGUI { if (NLMISC::startsWith(ht, "ui")) { - setText(CI18N::get(ht).toUtf8()); + setText(CI18N::get(ht)); _HardText = ht; } else @@ -3346,7 +3346,7 @@ namespace NLGUI pTooltip->setRenderLayer(getRenderLayer()); std::string tempTooltipStr = tempTooltips[i].toUtf8(); 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->setParentPosRef(Hotspot_BR); pTooltip->setPosRef(Hotspot_BR); diff --git a/nel/src/misc/common.cpp b/nel/src/misc/common.cpp index 184f550d5..cbc6ee070 100644 --- a/nel/src/misc/common.cpp +++ b/nel/src/misc/common.cpp @@ -884,7 +884,7 @@ std::string formatThousands(const std::string& s) { sint i, k; 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 if (remaining < 4) return s; diff --git a/nel/src/misc/i18n.cpp b/nel/src/misc/i18n.cpp index 27a47c2e4..729234f56 100644 --- a/nel/src/misc/i18n.cpp +++ b/nel/src/misc/i18n.cpp @@ -38,15 +38,18 @@ using namespace std; namespace NLMISC { -CI18N::StrMapContainer CI18N::_StrMap; -CI18N::StrMapContainer CI18N::_StrMapFallback; -bool CI18N::_StrMapLoaded = false; -const ucstring CI18N::_NotTranslatedValue(""); +CI18N::StrMapContainer CI18N::_StrMap; +CI18N::StrMapContainer CI18N::_StrMapFallback; +CI18N::StrMapContainer16 CI18N::_StrMap16; +CI18N::StrMapContainer16 CI18N::_StrMapFallback16; +bool CI18N::_StrMapLoaded = false; +const ucstring CI18N::_NotTranslatedValue16(""); +const std::string CI18N::_NotTranslatedValue(""); bool CI18N::_LanguagesNamesLoaded = false; string CI18N::_SelectedLanguageCode; CI18N::ILoadProxy *CI18N::_LoadProxy = 0; vector CI18N::_LanguageCodes; -vector CI18N::_LanguageNames; +vector CI18N::_LanguageNames; std::string CI18N::_SystemLanguageCode; bool CI18N::noResolution = false; @@ -65,17 +68,17 @@ void CI18N::initLanguages() _LanguageCodes.push_back("ru"); _LanguageCodes.push_back("es"); - _LanguageNames.push_back(ucstring("English")); - _LanguageNames.push_back(ucstring("French")); - _LanguageNames.push_back(ucstring("German")); - _LanguageNames.push_back(ucstring("Russian")); - _LanguageNames.push_back(ucstring("Spanish")); + _LanguageNames.push_back("English"); + _LanguageNames.push_back("French"); + _LanguageNames.push_back("German"); + _LanguageNames.push_back("Russian"); + _LanguageNames.push_back("Spanish"); _LanguagesNamesLoaded = true; } } -const std::vector &CI18N::getLanguageNames() +const std::vector &CI18N::getLanguageNames() { initLanguages(); @@ -91,19 +94,27 @@ const std::vector &CI18N::getLanguageCodes() void CI18N::load (const string &languageCode, const string &fallbackLanguageCode) { - if (_StrMapLoaded) _StrMap.clear (); - else _StrMapLoaded = true; + if (_StrMapLoaded) + { + _StrMap.clear(); + _StrMap16.clear(); + } + else + { + _StrMapLoaded = true; + } _SelectedLanguageCode = languageCode; - loadFileIntoMap(languageCode + ".uxt", _StrMap); + loadFileIntoMap(languageCode + ".uxt", _StrMap, _StrMap16); _StrMapFallback.clear(); + _StrMapFallback16.clear(); 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; // read in the text @@ -138,11 +149,12 @@ bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap) // ok, a line read. pair::iterator, bool> ret; - ret = destMap.insert(make_pair(label, ucs)); + ret = destMap16.insert(make_pair(label, ucs)); if (!ret.second) { 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); } @@ -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()); } + nlassert(destMap.size() == destMap16.size()); return true; } void CI18N::loadFromFilename(const string &filename, bool reload) { StrMapContainer destMap; - if (!loadFileIntoMap(filename, destMap)) + StrMapContainer16 destMap16; + if (!loadFileIntoMap(filename, destMap, destMap16)) { return; } @@ -167,16 +181,52 @@ void CI18N::loadFromFilename(const string &filename, bool 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()); } } + _StrMap16[it->first] = ucstring::makeFromUtf8(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 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(""; + return badString; +} + +const ucstring &CI18N::getAsUtf16 (const string &label) { if( noResolution ) { @@ -187,13 +237,13 @@ const ucstring &CI18N::get (const string &label) if (label.empty()) { - static ucstring emptyString; + static const ucstring 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; static CHashSet missingStrings; @@ -204,8 +254,8 @@ const ucstring &CI18N::get (const string &label) } // use the fall back language if it exists - it = _StrMapFallback.find(label); - if (it != _StrMapFallback.end()) + it = _StrMapFallback16.find(label); + if (it != _StrMapFallback16.end()) return it->second; static ucstring badString; @@ -229,7 +279,7 @@ bool CI18N::hasTranslation(const string &label) return false; } -ucstring CI18N::getCurrentLanguageName () +std::string CI18N::getCurrentLanguageName () { return get("LanguageName"); } @@ -379,7 +429,7 @@ std::string CI18N::getSystemLanguageCode () // locales names are different under Windows, for example: French_France.1252 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 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 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) { diff --git a/ryzom/client/src/bg_downloader_access.cpp b/ryzom/client/src/bg_downloader_access.cpp index 61364ea5f..2a0e2d73a 100644 --- a/ryzom/client/src/bg_downloader_access.cpp +++ b/ryzom/client/src/bg_downloader_access.cpp @@ -230,7 +230,7 @@ void CBGDownloaderAccess::CDownloadCoTask::run() // that the downloader is still running and in slave mode if (!isDownloaderProcessRunning() && getDownloaderMode() != DownloaderMode_Slave) { - throw EDownloadException(CI18N::get("uiBGD_DownloaderStopped").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_DownloaderStopped")); } } else @@ -429,7 +429,7 @@ void CBGDownloaderAccess::CDownloadCoTask::createDownloaderProcess() BOOL ok = NLMISC::launchProgram(BGDownloaderName, Parent->_CommandLine); if (!ok) { - throw EDownloadException(CI18N::get("uiBGD_LaunchError").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_LaunchError")); } } else @@ -458,7 +458,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() { nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with NULL pid"); // some problem here ... - throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance")); } } 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"); // 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 @@ -475,7 +475,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() if (!Parent->_RyzomInstPIDPtr) { // really, really bad luck ... - throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance")); } *(uint32 *) Parent->_RyzomInstPIDPtr = (uint32) GetCurrentProcessId(); @@ -514,7 +514,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() const uint32 totalTries = 7; 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); NLMISC::CMemStream dummyMsg; @@ -758,7 +758,7 @@ void CBGDownloaderAccess::CDownloadCoTask::waitMsg(BGDownloader::TMsgType wanted if (msgType != wantedMsgType) { 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()) { - throw EDownloadException(CI18N::get("uiBGD_DownloaderDisconnected").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_DownloaderDisconnected")); } } diff --git a/ryzom/client/src/client_chat_manager.cpp b/ryzom/client/src/client_chat_manager.cpp index a61c21701..09b1140d4 100644 --- a/ryzom/client/src/client_chat_manager.cpp +++ b/ryzom/client/src/client_chat_manager.cpp @@ -1176,9 +1176,9 @@ class CHandlerTell : public IActionHandler void execute (CCtrlBase *pCaller, const std::string &sParams) { string receiver = getParam (sParams, "player"); - ucstring message; - message.fromUtf8(getParam (sParams, "text")); -// message = getParam (sParams, "text"); + string message; + message = getParam (sParams, "text"); + if (receiver.empty() || message.empty()) return; @@ -1194,10 +1194,10 @@ class CHandlerTell : public IActionHandler // display in the good window CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); - ucstring finalMsg; + string finalMsg; 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") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true); @@ -1206,7 +1206,7 @@ class CHandlerTell : public IActionHandler // TDataSetIndex dsi; // not used .... PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA()); - ucstring s = CI18N::get("youTellPlayer"); + string s = CI18N::get("youTellPlayer"); strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); @@ -1341,9 +1341,7 @@ class CHandlerTalk : public IActionHandler // Param uint mode; fromString(getParam (sParams, "mode"), mode); - ucstring text; - text.fromUtf8 (getParam (sParams, "text")); -// text = getParam (sParams, "text"); + string text = getParam (sParams, "text"); // Parse any tokens in the text if ( ! CInterfaceManager::parseTokens(text)) @@ -1356,7 +1354,7 @@ class CHandlerTalk : public IActionHandler { if(text[0] == '/') { - string str = text.toUtf8(); + string str = text; string cmdWithArgs = str.substr(1); // Get the command name from the string, can contain spaces diff --git a/ryzom/client/src/client_sheets/item_sheet.cpp b/ryzom/client/src/client_sheets/item_sheet.cpp index 04d0737e1..25d66acce 100644 --- a/ryzom/client/src/client_sheets/item_sheet.cpp +++ b/ryzom/client/src/client_sheets/item_sheet.cpp @@ -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; for(uint i=0;i string sys; - sys = "Language "+CI18N::getCurrentLanguageName().toString() +" "; + sys = "Language "+CI18N::getCurrentLanguageName() +" "; if (!args.empty()) { @@ -1306,9 +1306,9 @@ NLMISC_COMMAND(execScript, "Execute a script file (.cmd)","") inComment++; if(inComment<=0) { - ucstring ucline(line); + string ucline(line); CInterfaceManager::parseTokens(ucline); - ICommand::execute(ucline.toUtf8(), g_log); + ICommand::execute(ucline, g_log); } if(strncmp(line, "*/", 2)==0) inComment--; diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index 1ce257f2c..39493495f 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -1021,7 +1021,7 @@ TInterfaceState globalMenu() // Display the firewall alert string CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:outgame:connecting:title")); 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 nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts @@ -1237,8 +1237,8 @@ TInterfaceState globalMenu() if (pVT != NULL) { pVT->setMultiLine( true ); - pVT->setText(CI18N::get("uiFirewallFail").toUtf8()+".\n"+ - CI18N::get("uiFirewallAlert").toUtf8()+"."); + pVT->setText(CI18N::get("uiFirewallFail")+".\n"+ + CI18N::get("uiFirewallAlert")+"."); } } } @@ -1319,7 +1319,7 @@ public: if (pVT == NULL) return; if (rCS.Name.empty()) - pVT->setText(CI18N::get("uiEmptySlot").toUtf8()); + pVT->setText(CI18N::get("uiEmptySlot")); else pVT->setText(rCS.Name.toUtf8()); } @@ -1328,7 +1328,7 @@ public: { CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sPath+":text"+NLMISC::toString(i))); 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(result); 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(R2::getEditor().getAccessMode()!=R2::CEditor::AccessDM) - okButton->setHardText(CI18N::get("uiR2EDLaunchScenario").toString()); + okButton->setHardText(CI18N::get("uiR2EDLaunchScenario")); 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); - if(rules==CI18N::get("uiR2EDliberal").toString()) + if(rules==CI18N::get("uiR2EDliberal")) ruleType = TRuleType(TRuleType::rt_liberal); - else if(rules == CI18N::get("uiR2EDstrict").toString()) + else if(rules == CI18N::get("uiR2EDstrict")) ruleType = TRuleType(TRuleType::rt_strict); volatile static bool override = false; if (override) @@ -3250,7 +3250,7 @@ class CAHLoadScenario : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); 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"); return; @@ -3331,7 +3331,7 @@ class CAHLoadScenario : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); 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"); } @@ -3360,7 +3360,7 @@ class CAHLoadScenario : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); 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"); } } diff --git a/ryzom/client/src/debug_client.cpp b/ryzom/client/src/debug_client.cpp index dd182f3c9..30e2645bf 100644 --- a/ryzom/client/src/debug_client.cpp +++ b/ryzom/client/src/debug_client.cpp @@ -529,7 +529,7 @@ string getDebugInformation() str += toString("ServerTick: %u\n", NetMngr.getCurrentServerTick()); str += toString("ConnectState: %s\n", NetMngr.getConnectionStateCStr()); 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()); if (ClientCfg.R2Mode) { diff --git a/ryzom/client/src/init.cpp b/ryzom/client/src/init.cpp index 5e7b03549..28d14dc7b 100644 --- a/ryzom/client/src/init.cpp +++ b/ryzom/client/src/init.cpp @@ -578,7 +578,7 @@ void checkDriverDepth () #else if (mode.Depth != 16 && mode.Depth != 24 && mode.Depth != 32) #endif - ExitClientError (CI18N::get ("uiDesktopNotIn32").toUtf8().c_str ()); + ExitClientError (CI18N::get ("uiDesktopNotIn32").c_str ()); } } @@ -1058,7 +1058,7 @@ void prelogInit() 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 return; } @@ -1149,14 +1149,14 @@ void prelogInit() string msg; if (mode.Windowed) { - msg = CI18N::get ("can_t_create_a_window_display").toUtf8(); + msg = CI18N::get ("can_t_create_a_window_display"); } 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 += CI18N::get ("bits").toUtf8 (); + msg += CI18N::get ("bits"); msg += ")"; ExitClientError (msg.c_str (), mode.Width, mode.Height, mode.Depth); // ExitClientError() call exit() so the code after is never called diff --git a/ryzom/client/src/init_main_loop.cpp b/ryzom/client/src/init_main_loop.cpp index 9c8890775..a1caef841 100644 --- a/ryzom/client/src/init_main_loop.cpp +++ b/ryzom/client/src/init_main_loop.cpp @@ -1692,7 +1692,7 @@ void initBloomConfigUI() if(!supportBloom) { if(group) - group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom").toUtf8()); + group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom")); ClientCfg.writeBool("FXAA", false); ClientCfg.writeBool("Bloom", false); diff --git a/ryzom/client/src/interface_v3/action_handler_game.cpp b/ryzom/client/src/interface_v3/action_handler_game.cpp index 2901bb261..4281181a9 100644 --- a/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -2140,7 +2140,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler pVBR->setColor(CRGBA(0,0,0,0)); if (pTooltip) - pTooltip->setDefaultContextHelp(CI18N::get("uittTargetUnknown").toUtf8()); + pTooltip->setDefaultContextHelp(CI18N::get("uittTargetUnknown")); return; } @@ -2205,7 +2205,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler sint min = (nForceRegion-2) * 50 + (nLevelForce-1) * 10 + 1; sint max = (nForceRegion-2) * 50 + nLevelForce * 10; - str= CI18N::get("uittTargetLevel").toUtf8(); + str= CI18N::get("uittTargetLevel"); strFindReplace(str, "%min", toString(min)); strFindReplace(str, "%max", toString(max)); } @@ -2214,16 +2214,16 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler { sint n = (nForceRegion-1) * 50; if (pE->isNPC()) - str= CI18N::get("uittTargetGuardBoss").toUtf8(); + str= CI18N::get("uittTargetGuardBoss"); else - str= CI18N::get("uittTargetBoss").toUtf8(); + str= CI18N::get("uittTargetBoss"); strFindReplace(str, "%n", toString("%d", n) ); } // Named else { sint n = (nForceRegion-1) * 50; - str= CI18N::get("uittTargetNamed").toUtf8(); + str= CI18N::get("uittTargetNamed"); strFindReplace(str, "%n", toString("%d", n) ); } @@ -3094,10 +3094,10 @@ public: if( pCB ) { pCB->resetTexts(); - pCB->addText(CI18N::get("uigcLowTextureMode").toUtf8()); - pCB->addText(CI18N::get("uigcNormalTextureMode").toUtf8()); + pCB->addText(CI18N::get("uigcLowTextureMode")); + pCB->addText(CI18N::get("uigcNormalTextureMode")); if(ClientCfg.HDTextureInstalled) - pCB->addText(CI18N::get("uigcHighTextureMode").toUtf8()); + pCB->addText(CI18N::get("uigcHighTextureMode")); } // Anisotropic Filtering @@ -3110,7 +3110,7 @@ public: sint maxAnisotropic = (sint)Driver->getAnisotropicFilterMaximum(); pCB->resetTexts(); - pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone").toUtf8()); + pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone")); sint anisotropic = 2; uint i = 1; diff --git a/ryzom/client/src/interface_v3/action_handler_help.cpp b/ryzom/client/src/interface_v3/action_handler_help.cpp index 4e92c67fb..0eb240b7d 100644 --- a/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -992,9 +992,7 @@ class CHandlerBrowse : public IActionHandler } } - ucstring ucparams(params); - CInterfaceManager::parseTokens(ucparams); - params = ucparams.toUtf8(); + CInterfaceManager::parseTokens(params); // go. NB: the action handler himself may translate params from utf8 CAHManager::getInstance()->runActionHandler(action, elementGroup, params); @@ -2014,7 +2012,7 @@ void getItemText (CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS) if(pIS->canBuildSomeItemPart()) { ucstring fmt= CI18N::get("uihelpItemMPCraft"); - ucstring ipList; + std::string ipList; pIS->getItemPartListAsText(ipList); strFindReplace(fmt, "%ip", ipList); strFindReplace(itemText, "%craft", fmt); @@ -2200,7 +2198,7 @@ static void setupRawMaterialStats(CSheetHelpSetup &setup) 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) { view->setActive(true); - view->setTextFormatTaged(CI18N::get("uihelpPhraseHeaderBricks").toUtf8()); + view->setTextFormatTaged(CI18N::get("uihelpPhraseHeaderBricks")); } } @@ -3476,73 +3474,73 @@ void setConsoModSuccessTooltip( CDBCtrlSheet *cs ) string ustr; 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); } else 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); } else 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); } else 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); } else 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); } else 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); } else 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); } else 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); } else 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); } else 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); } else 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); } else 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); } @@ -3576,19 +3574,19 @@ public: // special tooltip? (pvp outpost and xp catalyzer) sint specialTTId= getBonusMalusSpecialTT(cs); if(specialTTId==BONUS_MALUS::XpCatalyser) - CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittXpBonus").toUtf8()); + CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittXpBonus")); 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) - CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOutOfZone").toUtf8()); + CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOutOfZone")); 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) { CCDBNodeLeaf * node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEATH_XP_MALUS", false); if( node ) { - string txt = CI18N::get("uittDeathPenalty").toUtf8(); + string txt = CI18N::get("uittDeathPenalty"); strFindReplace(txt, "%dp", toString((100*node->getValue16())/254)); CWidgetManager::getInstance()->setContextHelpText(txt); } @@ -3600,7 +3598,7 @@ public: std::string str; cs->getContextHelp(str); - str+= CI18N::get("uittAuraDisabled").toUtf8(); + str+= CI18N::get("uittAuraDisabled"); // and replace the context help that is required. CWidgetManager::getInstance()->setContextHelpText(str); @@ -3838,7 +3836,7 @@ static void onMpChangeItemPart(CInterfaceGroup *wnd, uint32 itemSheetId, const s CViewText *statTitle= dynamic_cast(groupStat->getElement(groupStat->getId()+":text" )); CDBViewBar *statValue= dynamic_cast(groupStat->getElement(groupStat->getId()+":bar" )); if(statTitle) - statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType).toUtf8()); + statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType)); if(statValue) statValue->setValue(itemPart.Stats[i]); } diff --git a/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/ryzom/client/src/interface_v3/action_phrase_faber.cpp index 22a30b424..6591472d4 100644 --- a/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -1790,7 +1790,7 @@ void CActionPhraseFaber::updateItemResult() uint sv= uint(statArray[i]*100); if(statTitle) { - statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType).toUtf8()); + statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType)); statTitle->setColor(usageColor); } if(statValueBar) @@ -1810,12 +1810,12 @@ void CActionPhraseFaber::updateItemResult() // display something only for magic/protect stat if( RM_FABER_STAT_TYPE::isMagicResistStat(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 statToolTip->setDefaultContextHelp(std::string()); } else - statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed").toUtf8()); + statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed")); } } diff --git a/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp b/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp index 0fc03124a..e5f8cf1e4 100644 --- a/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp +++ b/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp @@ -189,7 +189,7 @@ void CBotChatPageDynamicMission::update() else { // 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")); } } } diff --git a/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index 913e47c2e..8fa8bd08e 100644 --- a/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -600,12 +600,12 @@ void CBotChatPageTrade::updateTradeModal() if (_BuyMean == MoneyGuildXP) { if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney")); } else { if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildMoney")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildMoney").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildMoney")); } return; } @@ -616,7 +616,7 @@ void CBotChatPageTrade::updateTradeModal() if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP")); return; } } @@ -677,7 +677,7 @@ void CBotChatPageTrade::updateTradeModal() if (cantTradeGroup) cantTradeGroup->setActive(true); // can't sell more than what is in inventory if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBCNotAvailable")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBCNotAvailable").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBCNotAvailable")); ok= false; } @@ -692,7 +692,7 @@ void CBotChatPageTrade::updateTradeModal() if (cantTradeGroup) cantTradeGroup->setActive(true); // can't sell more than what is in inventory if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity")); ok= false; } } @@ -710,7 +710,7 @@ void CBotChatPageTrade::updateTradeModal() if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (cantTradeGroup) cantTradeGroup->setActive(true); 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) { @@ -722,7 +722,7 @@ void CBotChatPageTrade::updateTradeModal() confirmTradeGroup->setActive(false); cantTradeGroup->setActive(true); 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 { @@ -745,7 +745,7 @@ void CBotChatPageTrade::updateTradeModal() if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughSkillPoints")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughSkillPoints").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughSkillPoints")); } else { @@ -761,7 +761,7 @@ void CBotChatPageTrade::updateTradeModal() if (confirmTradeGroup) confirmTradeGroup->setActive(false); if (cantTradeGroup) cantTradeGroup->setActive(true); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP")); - if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP").toUtf8()); + if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP")); } else { @@ -780,7 +780,7 @@ void CBotChatPageTrade::updateTradeModal() if (cantTradeGroup) cantTradeGroup->setActive(true); // can't sell less than the basic price 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 @@ -812,7 +812,7 @@ void CBotChatPageTrade::updateTradeModal() if (_SellDlgOn && priceWithoutFame == 0) { 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::max()) { @@ -821,7 +821,7 @@ void CBotChatPageTrade::updateTradeModal() else if (quantity == 0 || quantity == std::numeric_limits::max()) { 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(ig->getView( "standard_price:total_price_header" )); if ( _BuyMean == Money && priceLabel ) { - priceLabel->setText( CI18N::get( "uiPrice" ).toUtf8() ); + priceLabel->setText( CI18N::get( "uiPrice" ) ); priceLabel->setActive(true); } else @@ -977,7 +977,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal CViewText *priceLabel = dynamic_cast(ig->getView( "standard_price:total_price_header" )); if ( priceLabel ) { - priceLabel->setText( CI18N::get( "uiImmediatePrice" ).toUtf8() ); + priceLabel->setText( CI18N::get( "uiImmediatePrice" ) ); priceLabel->setActive(true); } @@ -1003,7 +1003,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal { confirmButton->setActive( !sheet->getLockedByOwner() ); confirmButton->setText(CI18N::get("uiSellImmediately")); - confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton").toUtf8()); + confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton")); } // set item or skill name diff --git a/ryzom/client/src/interface_v3/chat_window.cpp b/ryzom/client/src/interface_v3/chat_window.cpp index 72a877cb7..354a4c833 100644 --- a/ryzom/client/src/interface_v3/chat_window.cpp +++ b/ryzom/client/src/interface_v3/chat_window.cpp @@ -472,25 +472,25 @@ void CChatWindow::setHeaderColor(const std::string &n) //================================================================================= void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/) { - ucstring finalMsg; + string finalMsg; CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); 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") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); encodeColorTag(prop.getRGBA(), finalMsg, true); - finalMsg += msg; + finalMsg += msg.toUtf8(); - ucstring s = CI18N::get("youTellPlayer"); - strFindReplace(s, "%name", receiver); + string s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver.toUtf8()); strFindReplace(finalMsg, CI18N::get("youTell"), s); displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks); 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) // 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. // 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'}; - ucstring str; + static char ConvTable[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'F'}; + string str; if (append) { str.reserve(7 + str.size()); @@ -1273,7 +1273,7 @@ public: { CGroupEditBox *pEB = dynamic_cast(pCaller); if (pEB == NULL) return; - ucstring text = pEB->getInputStringAsUtf16(); + string text = pEB->getInputString(); // If the line is empty, do nothing if(text.empty()) return; @@ -1297,7 +1297,7 @@ public: if(text[0] == '/') { CChatWindow::_ChatWindowLaunchingCommand = chat; - string str = text.toUtf8(); + string str = text; string cmdWithArgs = str.substr(1); // Get the command name from the string, can contain spaces diff --git a/ryzom/client/src/interface_v3/chat_window.h b/ryzom/client/src/interface_v3/chat_window.h index 278824753..0c8811842 100644 --- a/ryzom/client/src/interface_v3/chat_window.h +++ b/ryzom/client/src/interface_v3/chat_window.h @@ -156,7 +156,7 @@ public: 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 - 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: diff --git a/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp b/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp index c75dc3af3..5a1952735 100644 --- a/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp @@ -1119,10 +1119,10 @@ void CDBGroupBuildPhrase::updateAllDisplay(const CSPhraseCom &phrase) { word.InfoView->setActive(true); if(i==0) - word.InfoView->setText( CI18N::get("uiTextHelpSelectRootBrick").toUtf8() ); + word.InfoView->setText( CI18N::get("uiTextHelpSelectRootBrick") ); else // start effect index at 1 (human readable :) ) - word.InfoView->setText( CI18N::get("uiTextHelpSelectEffectBrick").toUtf8() + toString(i) ); + word.InfoView->setText( CI18N::get("uiTextHelpSelectEffectBrick") + toString(i) ); } } diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index fed48d1ac..0a474b650 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -1058,7 +1058,7 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem() if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item) { if(!Ctrl->checkItemRequirement()) - text= CI18N::get("uiItemCannotUseColor").toUtf8() + text; + text= CI18N::get("uiItemCannotUseColor") + text; } // For item, add some information @@ -1070,17 +1070,17 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem() // Add craft info for MP if(pIS->Family==ITEMFAMILY::RAW_MATERIAL) { - ucstring ipList; + string ipList; pIS->getItemPartListAsText(ipList); if(ipList.empty()) { if(pIS->isUsedAsCraftRequirement()) - text+= "\n" + CI18N::get("uiItemMpCraftRequirement").toUtf8(); + text+= "\n" + CI18N::get("uiItemMpCraftRequirement"); else - text+= "\n" + CI18N::get("uiItemMpNoCraft").toUtf8(); + text+= "\n" + CI18N::get("uiItemMpNoCraft"); } else - text+= "\n" + CI18N::get("uiItemMpCanCraft").toUtf8() + ipList.toUtf8(); + text+= "\n" + CI18N::get("uiItemMpCanCraft") + ipList; } } } diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp index 0005d80f4..aec03653b 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp @@ -254,10 +254,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT switch ( Ctrl->getSheetCategory() ) { case CDBCtrlSheet::Item: break; // none for item. consider useless - case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact").toUtf8() + text; break; - case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill").toUtf8() + text; break; - case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill").toUtf8() + text; break; - case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase").toUtf8() + text; break; + case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact") + text; break; + case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill") + text; break; + case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill") + text; break; + case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase") + text; break; default: break; } @@ -269,10 +269,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT { STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); text += string("\n") + CUtfStringView(pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()))).toUtf8(); - text += "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(pOBS->CostDapper)); - text += CI18N::get("uiBotChatTime").toUtf8() + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute").toUtf8(); + text += "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pOBS->CostDapper)); + text += CI18N::get("uiBotChatTime") + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute"); 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; pPM->getCombatWeaponRestriction(weaponRestriction, Ctrl->getSheetId(),melee,range); // 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; text+= "\n" + weaponRestriction.toUtf8(); @@ -297,7 +297,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item) { if(!Ctrl->checkItemRequirement()) - colorTag= CI18N::get("uiItemCannotUseColor").toUtf8(); + colorTag= CI18N::get("uiItemCannotUseColor"); } // For item, add some information @@ -309,17 +309,17 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT // Add craft info for MP if(pIS->Family==ITEMFAMILY::RAW_MATERIAL) { - ucstring ipList; + string ipList; pIS->getItemPartListAsText(ipList); if(ipList.empty()) { if(pIS->isUsedAsCraftRequirement()) - text+= "\n" + CI18N::get("uiItemMpCraftRequirement").toUtf8(); + text+= "\n" + CI18N::get("uiItemMpCraftRequirement"); else - text+= "\n" + CI18N::get("uiItemMpNoCraft").toUtf8(); + text+= "\n" + CI18N::get("uiItemMpNoCraft"); } 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 (LastPrice != -1) - text+= "\n" + CI18N::get("uiBotChatSkillPointCost").toUtf8() + toString(LastPrice); + text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(LastPrice); else - text+= "\n" + CI18N::get("uiBotChatSkillPointCostNotReceived").toUtf8(); + text+= "\n" + CI18N::get("uiBotChatSkillPointCostNotReceived"); } else { @@ -345,8 +345,8 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT const CItemSheet *pIS = Ctrl->asItemSheet(); if (pIS && pIS->Family == ITEMFAMILY::GUILD_OPTION) { - text+= "\n" + CI18N::get("uiBotChatSkillPointCost").toUtf8() + toString(pIS->GuildOption.XPCost); - text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost)); + text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(pIS->GuildOption.XPCost); + text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost)); guildOption= true; } } @@ -381,10 +381,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT if (LastPrice > 0) { 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) )) + ")"; 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)) @@ -394,8 +394,8 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT else text+= "\n"; - text+= CI18N::get("uiBotChatFactionType").toUtf8() + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType) - + CI18N::get("uiBotChatFactionPointPrice").toUtf8() + NLMISC::formatThousands(toString(LastFactionPointPrice)); + text+= CI18N::get("uiBotChatFactionType") + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType) + + CI18N::get("uiBotChatFactionPointPrice") + NLMISC::formatThousands(toString(LastFactionPointPrice)); } // some additional info for resale @@ -407,31 +407,31 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT { // append price 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)) + ")"; else - text+= CI18N::get("uiBotChatRetirePrice").toUtf8() + NLMISC::formatThousands(toString(factor * LastPriceRetire)); + text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(factor * LastPriceRetire)); // 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, "%h", toString(LastResaleTimeLeft%RYZOM_DAY_IN_HOUR)); text+= "\n" + fmt; // force special color (according if retirable or not) if(LastSellerType == BOTCHATTYPE::UserRetirable || LastSellerType == BOTCHATTYPE::ResaleAndUserRetirable) - colorTag= CI18N::get("uiItemUserSellColor").toUtf8(); + colorTag= CI18N::get("uiItemUserSellColor"); else - colorTag= CI18N::get("uiItemUserSellColorNotRetirable").toUtf8(); + colorTag= CI18N::get("uiItemUserSellColorNotRetirable"); } // Append (NPC) tag if NPC item 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 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() && (LastSellerType == BOTCHATTYPE::User || LastSellerType == BOTCHATTYPE::UserRetirable) ) { - text+= "\n" + CI18N::get("uiItemSold").toUtf8(); + text+= "\n" + CI18N::get("uiItemSold"); // force special color - colorTag= CI18N::get("uiItemSoldColor").toUtf8(); + colorTag= CI18N::get("uiItemSoldColor"); } // error case else { - text+= "\n" + CI18N::get("uiPriceNotReceived").toUtf8(); + text+= "\n" + CI18N::get("uiPriceNotReceived"); } } } diff --git a/ryzom/client/src/interface_v3/group_compas.cpp b/ryzom/client/src/interface_v3/group_compas.cpp index f00b72cb2..b43f50a89 100644 --- a/ryzom/client/src/interface_v3/group_compas.cpp +++ b/ryzom/client/src/interface_v3/group_compas.cpp @@ -425,7 +425,7 @@ void CGroupCompas::draw() if (toolTip) { if (displayedTarget.getType() != CCompassTarget::North) - toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance")); else toolTip->setDefaultContextHelp(std::string()); } diff --git a/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index e18cf0cc9..bd339d19d 100644 --- a/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -1122,7 +1122,7 @@ void CGroupInSceneUserInfo::updateDynamicData () { CInterfaceGroup *group = getGroup ("right"); CForageSourceCL *forageSource = static_cast(_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"); if ( toolTip ) toolTip->setDefaultContextHelp( txt ); diff --git a/ryzom/client/src/interface_v3/group_map.cpp b/ryzom/client/src/interface_v3/group_map.cpp index cdda9e915..ac70c57cc 100644 --- a/ryzom/client/src/interface_v3/group_map.cpp +++ b/ryzom/client/src/interface_v3/group_map.cpp @@ -697,7 +697,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) { _HomeLM->setParent(this); addCtrl(_HomeLM); - _HomeLM->setDefaultContextHelp(NLMISC::CI18N::get("uiHome").toUtf8()); + _HomeLM->setDefaultContextHelp(NLMISC::CI18N::get("uiHome")); } // create animals Landmark: pack Animals. @@ -709,7 +709,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) { _AnimalLM[i]->setParent(this); 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); 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()); 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::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))); } } } diff --git a/ryzom/client/src/interface_v3/guild_manager.cpp b/ryzom/client/src/interface_v3/guild_manager.cpp index a6b24e670..331b0ebfe 100644 --- a/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/ryzom/client/src/interface_v3/guild_manager.cpp @@ -837,13 +837,13 @@ class CAHGuildSheetOpen : public IActionHandler if (pViewGrade != NULL) { 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) - pViewGrade->setText (CI18N::get("uiGuildHighOfficer").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildHighOfficer")); else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Officer) - pViewGrade->setText (CI18N::get("uiGuildOfficer").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildOfficer")); else - pViewGrade->setText (CI18N::get("uiGuildMember").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildMember")); } // online? @@ -857,17 +857,17 @@ class CAHGuildSheetOpen : public IActionHandler case ccs_online: onlineView->setTexture("w_online.tga"); if (toolTip) - toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline")); break; case ccs_online_abroad: onlineView->setTexture("w_online_abroad.tga"); if (toolTip) - toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad")); break; default: onlineView->setTexture("w_offline.tga"); if (toolTip) - toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOffline").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOffline")); break; } } diff --git a/ryzom/client/src/interface_v3/interface_manager.cpp b/ryzom/client/src/interface_v3/interface_manager.cpp index 949a599b4..3bae5ccbc 100644 --- a/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1535,8 +1535,8 @@ void CInterfaceManager::updateFrameEvents() CCtrlBase *pTooltip= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather_tt")); if (pTooltip != NULL) { - string tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour").toUtf8() + - " - " + CI18N::get("uiHumidity").toUtf8() + " " + + string tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour") + + " - " + CI18N::get("uiHumidity") + " " + toString("%d", (uint)(roundWeatherValue(WeatherManager.getNextWeatherValue()) * 100.f)) + "%"; 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. */ -bool CInterfaceManager::parseTokens(ucstring& ucstr) +bool CInterfaceManager::parseTokens(string& ucstr) { - ucstring str = ucstr; - ucstring start_token("$"); - ucstring end_token("$"); + string str = ucstr; + string start_token("$"); + string end_token("$"); size_t start_pos = 0; size_t end_pos = 1; @@ -4061,8 +4061,8 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) // Get the whole token substring first end_pos = str.find(end_token, start_pos + 1); - if ((start_pos == ucstring::npos) || - (end_pos == ucstring::npos) || + if ((start_pos == string::npos) || + (end_pos == string::npos) || (end_pos <= start_pos + 1)) { // Wrong formatting; give up on this one. @@ -4080,19 +4080,19 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) continue; } - ucstring token_whole = str.luabind_substr(start_pos, end_pos - start_pos + 1); - ucstring token_string = token_whole.luabind_substr(1, token_whole.length() - 2); - ucstring token_replacement = token_whole; - ucstring token_default = token_whole; + string token_whole = str.substr(start_pos, end_pos - start_pos + 1); + string token_string = token_whole.substr(1, token_whole.length() - 2); + string token_replacement = token_whole; + string token_default = token_whole; - ucstring token_subject; - ucstring token_param; + string token_subject; + string token_param; // Does the token have a parameter? // If not it is 'name' by default - vector token_vector; - vector param_vector; - splitUCString(token_string, ucstring("."), token_vector); + vector token_vector; + vector param_vector; + splitString(token_string, ".", token_vector); if (token_vector.empty()) { // Wrong formatting; give up on this one. @@ -4102,23 +4102,23 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) token_subject = token_vector[0]; if (token_vector.size() == 1) { - splitUCString(token_subject, ucstring("/"), param_vector); - token_subject = !param_vector.empty() ? param_vector[0] : ucstring(""); - token_param = ucstring("name"); + splitString(token_subject, "/", param_vector); + token_subject = !param_vector.empty() ? param_vector[0] : string(); + token_param = string("name"); } else if (token_vector.size() > 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); - token_param = !param_vector.empty() ? param_vector[0] : ucstring(""); + splitString(token_vector[1], "/", param_vector); + token_param = !param_vector.empty() ? param_vector[0] : string(); } } // Get any default value, if not gs 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) { @@ -4126,9 +4126,9 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) token_replacement = param_vector[1]; // Delete following chars for every '\d' in default 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++; } token_default = token_replacement; @@ -4137,17 +4137,17 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) CEntityCL *pTokenSubjectEntity = NULL; - if (token_subject == ucstring("me")) + if (token_subject == "me") { pTokenSubjectEntity = static_cast(UserEntity); } - else if (token_subject == ucstring("t")) + else if (token_subject == "t") { // Target uint targetSlot = UserEntity->targetSlot(); pTokenSubjectEntity = EntitiesMngr.entity(targetSlot); } - else if (token_subject == ucstring("tt")) + else if (token_subject == "tt") { // Target's target uint targetSlot = UserEntity->targetSlot(); @@ -4165,11 +4165,11 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) } } else if ((token_subject.length() == 3) && - (token_subject.luabind_substr(0, 2) == ucstring("tm"))) + (token_subject.substr(0, 2) == "tm")) { // Teammate uint indexInTeam = 0; - fromString(token_subject.luabind_substr(2, 1).toString(), indexInTeam); + fromString(token_subject.substr(2, 1), indexInTeam); // Make 0-based --indexInTeam; @@ -4205,22 +4205,22 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) if (pTokenSubjectEntity != NULL) { // 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 if (name.empty()) { - name = pTokenSubjectEntity->getTitle(); + name = pTokenSubjectEntity->getTitle().toUtf8(); } 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; } - else if (token_param == ucstring("race")) + else if (token_param == "race") { CCharacterCL *pC = dynamic_cast(pTokenSubjectEntity); if (pC) @@ -4228,27 +4228,27 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) EGSPD::CPeople::TPeople race = pC->people(); 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; } } } - else if (token_param == ucstring("guild")) + else if (token_param == "guild") { STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); ucstring 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(") && - token_param.luabind_substr(token_param.length() - 1 , 1) == ucstring(")")) + else if (token_param.substr(0, 3) == "gs(" && + token_param.substr(token_param.length() - 1 , 1) == ")") { // Gender string - vector strList; - ucstring gender_string = token_param.luabind_substr(3, token_param.length() - 4); - splitUCString(gender_string, ucstring("/"), strList); + vector strList; + string gender_string = token_param.substr(3, token_param.length() - 4); + splitString(gender_string, "/", strList); if (strList.size() <= 1) { @@ -4277,8 +4277,8 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) { // Nothing to replace; show message and exit CInterfaceManager *im = CInterfaceManager::getInstance(); - ucstring message = ucstring(CI18N::get("uiUntranslatedToken")); - message.replace(message.find(ucstring("%s")), 2, token_whole); + string message = CI18N::get("uiUntranslatedToken"); + message.replace(message.find("%s"), 2, token_whole); im->displaySystemInfo(message); return false; } diff --git a/ryzom/client/src/interface_v3/interface_manager.h b/ryzom/client/src/interface_v3/interface_manager.h index 0b89584bc..342b8a7be 100644 --- a/ryzom/client/src/interface_v3/interface_manager.h +++ b/ryzom/client/src/interface_v3/interface_manager.h @@ -448,7 +448,7 @@ public: /** Parses any tokens in the ucstring like $t$ or $g()$ */ - static bool parseTokens(ucstring& ucstr); + static bool parseTokens(std::string& ucstr); // ------------------------------------------------------------------------------------------------ private: diff --git a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index e4dbb0f44..b36d51866 100644 --- a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -1050,7 +1050,7 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls) // Create a line pMenu->addLine(CI18N::get(sTmp), "lua", 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()) { // Parse any tokens in the message. - ucstring msg_modified = msg; + string msg_modified = msg.toUtf8(); // Parse any tokens in the text if (! CInterfaceManager::parseTokens(msg_modified)) diff --git a/ryzom/client/src/interface_v3/macrocmd_key.cpp b/ryzom/client/src/interface_v3/macrocmd_key.cpp index 9fce02ef8..d62a8746a 100644 --- a/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -492,7 +492,7 @@ void CModalContainerEditCmd::activate() } if (found) { - pCB->addText(CI18N::get(rVCat[i].LocalizedName).toUtf8()); + pCB->addText(CI18N::get(rVCat[i].LocalizedName)); 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; else sText = WinName+VIEW_EDITCMD_SECOND_PARAM_NAME; CViewText *pVT = dynamic_cast(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++; } } @@ -778,7 +778,7 @@ void CModalContainerEditCmd::invalidCurrentCommand() { // Dont display key shortcut if we are in creation mode pVT= dynamic_cast(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 pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); @@ -897,7 +897,7 @@ void CModalContainerEditCmd::validCurrentCommand() CurrentEditCmdLine.Combo.Key = KeyCount; CurrentEditCmdLine.Combo.KeyButtons = noKeyButton; // 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 CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (true); @@ -1033,7 +1033,7 @@ void CModalContainerEditCmd::onChangeCategory() { 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(CWidgetManager::getInstance()->getElementFromId(sViewText)); if (pViewParamName != NULL) - pViewParamName->setText (CI18N::get(rP.LocalizedName).toUtf8()); + pViewParamName->setText (CI18N::get(rP.LocalizedName)); } if (rP.Type == CBaseAction::CParameter::Constant) @@ -1131,7 +1131,7 @@ void CModalContainerEditCmd::onChangeAction() if (ActionsContext.matchContext(rVal.Contexts)) { if (NLMISC::startsWith(rVal.LocalizedValue, "ui")) - pCB->addText(CI18N::get(rVal.LocalizedValue).toUtf8()); + pCB->addText(CI18N::get(rVal.LocalizedValue)); else pCB->addText(rVal.LocalizedValue); } diff --git a/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/ryzom/client/src/interface_v3/macrocmd_manager.cpp index 12b066fff..4b0d2fee9 100644 --- a/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -895,7 +895,7 @@ public: if (pVT != NULL) { 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 pVT->setText(pMCM->CurrentEditMacro.Combo.toUCString().toUtf8()); } @@ -1005,7 +1005,7 @@ void addMacroLine (CGroupList *pParent, uint macNb, const CMacroCmd ¯o) if (macro.Combo.Key != KeyCount) pVT->setText(macro.Combo.toUCString().toUtf8()); else - pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); + pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); } pNewMacro->setParent (pParent); diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index a0a7aed66..f7f9e05f2 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -492,7 +492,7 @@ void CMusicPlayer::clearPlayingInfo() { if (_Songs.empty()) { - updatePlayingInfo(CI18N::get("uiNoFiles").toUtf8()); + updatePlayingInfo(CI18N::get("uiNoFiles")); } else { @@ -632,7 +632,7 @@ void CMusicPlayer::createPlaylistFromMusic() join(extensions, ", ", extlist); extlist += ", m3u, m3u8"; - std::string msg(CI18N::get("uiMk_system6").toUtf8()); + std::string msg(CI18N::get("uiMk_system6")); msg += ": " + newPath + " (" + extlist + ")"; CInterfaceManager::getInstance()->displaySystemInfo(ucstring::makeFromUtf8(msg), "SYS"); nlinfo("%s", msg.c_str()); diff --git a/ryzom/client/src/interface_v3/people_list.cpp b/ryzom/client/src/interface_v3/people_list.cpp index b380c12b0..30a468975 100644 --- a/ryzom/client/src/interface_v3/people_list.cpp +++ b/ryzom/client/src/interface_v3/people_list.cpp @@ -471,14 +471,14 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c return; } - ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); - ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg; + string csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + string finalMsg = csr + CI18N::get("youTell") + ": " + msg.toUtf8(); // display msg with good color CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); - ucstring s = CI18N::get("youTellPlayer"); - strFindReplace(s, "%name", receiver); + string s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver.toUtf8()); strFindReplace(finalMsg, CI18N::get("youTell"), s); gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); @@ -759,17 +759,17 @@ void CPeopleList::setOnline(uint index, TCharConnectionState online) case ccs_online: onlineView->setTexture("w_online.tga"); if (toolTip) - toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnline").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnline")); break; case ccs_online_abroad: onlineView->setTexture("w_online_abroad.tga"); if (toolTip) - toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnlineAbroad").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnlineAbroad")); break; default: onlineView->setTexture("w_offline.tga"); if (toolTip) - toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOffline").toUtf8()); + toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOffline")); break; } } @@ -876,7 +876,7 @@ class CHandlerContactEntry : public IActionHandler { CGroupEditBox *pEB = dynamic_cast(pCaller); if (pEB == NULL) return; - ucstring text = pEB->getInputStringAsUtf16(); + string text = pEB->getInputString(); // If the line is empty, do nothing if(text.empty()) return; @@ -892,8 +892,7 @@ class CHandlerContactEntry : public IActionHandler if(text[0] == '/') { CChatWindow::_ChatWindowLaunchingCommand = NULL; // no CChatWindow instance there .. - // TODO : have NLMISC::ICommand accept unicode strings - std::string str = text.toUtf8().substr(1); + std::string str = text.substr(1); NLMISC::ICommand::execute( str, g_log ); pEB->setInputString (std::string()); return; @@ -904,10 +903,10 @@ class CHandlerContactEntry : public IActionHandler CGroupContainer *gc = static_cast< CGroupContainer* >( pCaller->getParent()->getEnclosingContainer() ); // title gives the name of the player - ucstring playerName = gc->getUCTitle(); + string playerName = gc->getUCTitle().toUtf8(); // Simply do a tell on the player - ChatMngr.tell(playerName.toString(), text); + ChatMngr.tell(playerName, text); pEB->setInputString (std::string()); if (gc) { @@ -940,18 +939,18 @@ class CHandlerContactEntry : public IActionHandler CChatGroupWindow *pWin = PeopleInterraction.getChatGroupWindow(); CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); - ucstring final; + string final; 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")+": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), final, true); final += text; pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str)); - ucstring s = CI18N::get("youTellPlayer"); - strFindReplace(s, "%name", pWin->getFreeTellerName(str)); + string s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", pWin->getFreeTellerName(str).toUtf8()); strFindReplace(final, CI18N::get("youTell"), s); CInterfaceManager::getInstance()->log(final, CChatGroup::groupTypeToString(CChatGroup::tell)); } diff --git a/ryzom/client/src/interface_v3/skill_manager.cpp b/ryzom/client/src/interface_v3/skill_manager.cpp index 5e91f6f6e..936db39a7 100644 --- a/ryzom/client/src/interface_v3/skill_manager.cpp +++ b/ryzom/client/src/interface_v3/skill_manager.cpp @@ -588,7 +588,7 @@ void CSkillManager::checkTitleUnblocked(CHARACTER_TITLE::ECharacterTitle i, bool string titleStr = CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)i); bool womenTitle = (UserEntity && UserEntity->getGender() == GSGENDER::female); 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 { diff --git a/ryzom/client/src/interface_v3/task_bar_manager.cpp b/ryzom/client/src/interface_v3/task_bar_manager.cpp index 7c9bb2a45..fcc4c30f2 100644 --- a/ryzom/client/src/interface_v3/task_bar_manager.cpp +++ b/ryzom/client/src/interface_v3/task_bar_manager.cpp @@ -182,7 +182,7 @@ public: if (it != acmap.end()) pVT->setText(it->second.toUCString().toUtf8()); else - pVT->setText(CI18N::get("uiNotAssigned").toUtf8()); + pVT->setText(CI18N::get("uiNotAssigned")); } } } diff --git a/ryzom/client/src/login_patch.cpp b/ryzom/client/src/login_patch.cpp index 926ed61b1..3d7a8a4c8 100644 --- a/ryzom/client/src/login_patch.cpp +++ b/ryzom/client/src/login_patch.cpp @@ -1931,9 +1931,9 @@ int CPatchManager::validateProgress(void *foo, double t, double d, double /* ult if (units.empty()) { - units.push_back(CI18N::get("uiByte").toUtf8()); - units.push_back(CI18N::get("uiKb").toUtf8()); - units.push_back(CI18N::get("uiMb").toUtf8()); + units.push_back(CI18N::get("uiByte")); + units.push_back(CI18N::get("uiKb")); + units.push_back(CI18N::get("uiMb")); } CPatchManager *pPM = CPatchManager::getInstance(); diff --git a/ryzom/client/src/main_loop_debug.cpp b/ryzom/client/src/main_loop_debug.cpp index ac29a3984..70616e1f7 100644 --- a/ryzom/client/src/main_loop_debug.cpp +++ b/ryzom/client/src/main_loop_debug.cpp @@ -716,7 +716,7 @@ static std::string getActionKey(const char* name, const char* param = "") if (ite != acmap.end()) return ite->second.toUCString().toString(); - return CI18N::get("uiNotAssigned").toString(); + return CI18N::get("uiNotAssigned"); } //--------------------------------------------------- diff --git a/ryzom/client/src/net_manager.cpp b/ryzom/client/src/net_manager.cpp index d1744f3ff..8d743074d 100644 --- a/ryzom/client/src/net_manager.cpp +++ b/ryzom/client/src/net_manager.cpp @@ -614,23 +614,23 @@ static CInterfaceChatDisplayer InterfaceChatDisplayer; void CInterfaceChatDisplayer::colorizeSender(ucstring &text, const ucstring &senderName, CRGBA baseColor) { // 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) { - ucstring str; + string str; CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); CChatWindow::encodeColorTag(prop.getRGBA(), str, false); - str += text.substr(0, pos+1); + str += text.toUtf8().substr(0, pos+1); CChatWindow::encodeColorTag(baseColor, str, true); - str += text.substr(pos+1); + str += text.toUtf8().substr(pos+1); - text.swap(str); + text.fromUtf8(str); } } diff --git a/ryzom/client/src/progress.cpp b/ryzom/client/src/progress.cpp index 133f5abd2..48d642aea 100644 --- a/ryzom/client/src/progress.cpp +++ b/ryzom/client/src/progress.cpp @@ -354,12 +354,12 @@ void CProgress::internalProgress (float value) // Print some more info uint32 day = RT.getRyzomDay(); - str = toString (CI18N::get ("uiTipsTeleport").toUtf8().c_str(), - CI18N::get (LoadingContinent->LocalizedName).toUtf8().c_str(), + str = toString (CI18N::get ("uiTipsTeleport").c_str(), + CI18N::get (LoadingContinent->LocalizedName).c_str(), day, (uint)RT.getRyzomTime(), - CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).toUtf8().c_str(), - CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).toUtf8().c_str()); + CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).c_str(), + CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).c_str()); ucstring ucstr; ucstr.fromUtf8 (str); TextContext->setHotSpot(UTextContext::MiddleBottom); diff --git a/ryzom/client/src/r2/auto_group.cpp b/ryzom/client/src/r2/auto_group.cpp index 7372d6e48..7bbeb39d3 100644 --- a/ryzom/client/src/r2/auto_group.cpp +++ b/ryzom/client/src/r2/auto_group.cpp @@ -281,7 +281,7 @@ void CAutoGroup::group(CObject *newEntityDesc, const NLMISC::CVectorD &createPos R2::getEditor().getEnv()["PaletteIdToGroupTranslation"][newEntityDesc->getAttr("Base")->toString()].push(); if (ls.isString(-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()); getEditor().getDMC().requestInsertNode(destGroup->getParentAct()->getId(), diff --git a/ryzom/client/src/r2/displayer_visual_entity.cpp b/ryzom/client/src/r2/displayer_visual_entity.cpp index 6e09e580e..344d2a8fa 100644 --- a/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -994,7 +994,7 @@ void CDisplayerVisualEntity::updateName() } std::string firstPart; if(actNb>0) - firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb); + firstPart = CI18N::get("uiR2EDDefaultActTitle") + " " + NLMISC::toString(actNb); if (act->isString("Name")) actName = act->toString("Name"); @@ -1006,7 +1006,7 @@ void CDisplayerVisualEntity::updateName() } else { - actName = CI18N::get("uiR2EDBaseAct").toString(); + actName = CI18N::get("uiR2EDBaseAct"); } actName = NLMISC::toString(" [%s]", actName.c_str()); diff --git a/ryzom/client/src/r2/displayer_visual_group.cpp b/ryzom/client/src/r2/displayer_visual_group.cpp index a84c6bfa4..5cf2c542d 100644 --- a/ryzom/client/src/r2/displayer_visual_group.cpp +++ b/ryzom/client/src/r2/displayer_visual_group.cpp @@ -76,7 +76,7 @@ public: virtual void getContextHelp(std::string &help) const { help = Instance.getDisplayName().toUtf8(); - if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8()) + if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear(); } bool emptyContextHelp() const { return true; } @@ -125,7 +125,7 @@ public: virtual void getContextHelp(std::string &help) const { help = Instance.getDisplayName().toUtf8(); - if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8()) + if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear(); } bool emptyContextHelp() const { return true; } diff --git a/ryzom/client/src/r2/editor.cpp b/ryzom/client/src/r2/editor.cpp index a708bc2a4..d3611067a 100644 --- a/ryzom/client/src/r2/editor.cpp +++ b/ryzom/client/src/r2/editor.cpp @@ -1761,7 +1761,7 @@ void CEditor::waitScenarioScreen() // Display the firewall alert string CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting:title")); 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 nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts @@ -1853,8 +1853,8 @@ void CEditor::waitScenarioScreen() if (pVT != NULL) { pVT->setMultiLine( true ); - pVT->setText(CI18N::get("uiFirewallFail").toUtf8()+".\n"+ - CI18N::get("uiFirewallAlert").toUtf8()+"."); + pVT->setText(CI18N::get("uiFirewallFail")+".\n"+ + CI18N::get("uiFirewallAlert")+"."); } } } @@ -6468,7 +6468,7 @@ void CEditor::connectionMsg(const std::string &stringId) CViewText *vt = dynamic_cast(r2ConnectWindow->getView("connexionMsg")); 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(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); 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"); } diff --git a/ryzom/client/src/r2/instance_map_deco.cpp b/ryzom/client/src/r2/instance_map_deco.cpp index 8ec630686..ae3857990 100644 --- a/ryzom/client/src/r2/instance_map_deco.cpp +++ b/ryzom/client/src/r2/instance_map_deco.cpp @@ -44,7 +44,7 @@ void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(std::string &help) cons { //H_AUTO(R2_CCtrlButtonEntity_getContextHelp) help = _Instance.getDisplayName().toUtf8(); - if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8()) + if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear(); } diff --git a/ryzom/client/src/r2/tool_select_move.cpp b/ryzom/client/src/r2/tool_select_move.cpp index f9b9b9a1a..d16b45ced 100644 --- a/ryzom/client/src/r2/tool_select_move.cpp +++ b/ryzom/client/src/r2/tool_select_move.cpp @@ -417,9 +417,9 @@ void CToolSelectMove::commitAction(CInstance &instance) } else { - ucstring instanceName = instance.getDisplayName(); + string instanceName = instance.getDisplayName().toUtf8(); if(instanceName == CI18N::get("uiR2EDNoName")) - instanceName = ucstring(instance.getClassName()); + instanceName = instance.getClassName(); //getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instance.getDisplayName()); getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instanceName); diff --git a/ryzom/client/src/session_browser_impl.cpp b/ryzom/client/src/session_browser_impl.cpp index f11c24a54..9f3cc77a9 100644 --- a/ryzom/client/src/session_browser_impl.cpp +++ b/ryzom/client/src/session_browser_impl.cpp @@ -230,7 +230,7 @@ int CSessionBrowserImpl::luaJoinRingSession(CLuaState &ls) { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); 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"); } diff --git a/ryzom/common/src/game_share/rm_family.cpp b/ryzom/common/src/game_share/rm_family.cpp index a45793aad..5351b00b7 100644 --- a/ryzom/common/src/game_share/rm_family.cpp +++ b/ryzom/common/src/game_share/rm_family.cpp @@ -118,7 +118,7 @@ namespace RM_FABER_TYPE } /// Client: use the CI18N - const ucstring& toLocalString( TRMFType e ) + const std::string& toLocalString( TRMFType e ) { return CI18N::get("mpft" + toString(e)); } @@ -134,7 +134,7 @@ namespace RM_FABER_TYPE namespace RM_FAMILY { /// Get the Localized UCString - const ucstring& toLocalString( TRMFamily e ) + const std::string& toLocalString( TRMFamily e ) { return CI18N::get("mpfam" + toString(e)); } @@ -144,7 +144,7 @@ namespace RM_FAMILY namespace RM_GROUP { /// Get the Localized UCString - const ucstring& toLocalString( TRMGroup e ) + const std::string& toLocalString( TRMGroup e ) { return CI18N::get("mpgroup" + toString(e)); } @@ -154,7 +154,7 @@ namespace RM_GROUP namespace RM_FABER_PROPERTY { /// Get the Localized UCString - const ucstring& toLocalString( TRMFProperty e ) + const std::string& toLocalString( TRMFProperty e ) { return CI18N::get("mpprop" + toString(e)); } @@ -188,7 +188,7 @@ namespace RM_FABER_QUALITY } /// Client: use the CI18N - const ucstring& toLocalString( TFaberQuality e ) + const std::string& toLocalString( TFaberQuality e ) { return CI18N::get("mpfq" + toString(e)); } @@ -224,7 +224,7 @@ namespace RM_COLOR } /// Get the Localized UCString - const ucstring& toLocalString( sint value ) + const std::string& toLocalString( sint value ) { return CI18N::get("mpcol" + toString(value)); } @@ -283,7 +283,7 @@ namespace RM_FABER_STAT_TYPE return conversion.toString(stats); } - const ucstring& toLocalString( TRMStatType stats ) + const std::string& toLocalString( TRMStatType stats ) { // must change en.uxt nlctassert(NumRMStatType == sizeof(stringTable)/sizeof(stringTable[0])); @@ -663,9 +663,9 @@ namespace RM_FABER_STAT_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)); } diff --git a/ryzom/common/src/game_share/rm_family.h b/ryzom/common/src/game_share/rm_family.h index a69a51517..9f9048531 100644 --- a/ryzom/common/src/game_share/rm_family.h +++ b/ryzom/common/src/game_share/rm_family.h @@ -85,7 +85,7 @@ namespace RM_FABER_TYPE const std::string &faberTypeToSheetEntry(TRMFType type); /// 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") std::string toIconDefineString( TRMFType e ); @@ -101,7 +101,7 @@ namespace RM_FAMILY const TRMFamily Unknown = 0; /// Get the Localized UCString - const ucstring& toLocalString( TRMFamily e ); + const std::string& toLocalString( TRMFamily e ); /// Debug string inline std::string toString( TRMFamily e ) { return NLMISC::toString(e); } @@ -119,7 +119,7 @@ namespace RM_GROUP const TRMGroup Unknown = 0; /// 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() @@ -138,7 +138,7 @@ namespace RM_FABER_PROPERTY const TRMFProperty Unknown = 0; /// Get the Localized UCString - const ucstring& toLocalString( TRMFProperty e ); + const std::string& toLocalString( TRMFProperty e ); /// Debug string inline std::string toString( TRMFProperty e ) { return NLMISC::toString(e); } @@ -178,7 +178,7 @@ namespace RM_FABER_QUALITY TFaberQuality toFaberQuality( const std::string& str ); /// 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 ); /// 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 ); /// 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? bool isStatRelevant(RM_FABER_TYPE::TRMFType ft, TRMStatType fs); @@ -309,7 +309,7 @@ namespace RM_CLASS_TYPE }; /// 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] inline TRMClassType getItemClass(uint32 energy) diff --git a/ryzom/common/src/game_share/roles.cpp b/ryzom/common/src/game_share/roles.cpp index 57ccfdcd4..578096b44 100644 --- a/ryzom/common/src/game_share/roles.cpp +++ b/ryzom/common/src/game_share/roles.cpp @@ -73,7 +73,7 @@ ERole toRoleId( const std::string& Role ) } // Return the Translated name of the Job -const ucstring &roleToUCString (ERole r) +const std::string &roleToUCString(ERole r) { return NLMISC::CI18N::get( toString( r ) ); } diff --git a/ryzom/common/src/game_share/roles.h b/ryzom/common/src/game_share/roles.h index 9164a3254..8b6dfd5b2 100644 --- a/ryzom/common/src/game_share/roles.h +++ b/ryzom/common/src/game_share/roles.h @@ -60,7 +60,7 @@ const std::string& toString( ERole r ); ERole toRoleId( const std::string& Role ); // Return the Translated name of the Job -const ucstring &roleToUCString (ERole r); +const std::string &roleToUCString (ERole r); } // ROLES