From 586e49282f2ade864801dfa733089994b2ce9cb2 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 12 Mar 2020 18:16:26 +0200 Subject: [PATCH] Changed: Translate icon text if starts with uiit --- .../client/src/interface_v3/dbctrl_sheet.cpp | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index fd21c20b2..d6b521672 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1888,24 +1888,30 @@ void CDBCtrlSheet::resetCharBitmaps() // *************************************************************************** void CDBCtrlSheet::setupCharBitmaps(sint32 maxW, sint32 maxLine, bool topDown) { - // Use the optString for the Macro name - _OptString = toLower(_OptString); - CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewRenderer &rVR = *CViewRenderer::getInstance(); - _CharBitmaps.clear(); + if(maxLine<=0) return; - if(maxLine<=0) - return; + std::string text(_OptString); + if (_Type != SheetType_Macro && text.size() > 4) + { + // check for icon text 'uiitLabel' + if (text[0] == 'u' && text[1] == 'i' && text[2] == 'i' && text[3] == 't' && CI18N::hasTranslation(text)) + { + // NOTE: translated text is expected to be us-ascii only + text = CI18N::get(text).toUtf8(); + } + } + + CViewRenderer &rVR = *CViewRenderer::getInstance(); uint h = rVR.getTypoTextureH('a'); sint lineNb = 0; sint curLineSize = 0; uint i; uint xChar= 0; - for (i = 0; i < _OptString.size(); ++i) + for (i = 0; i < text.size(); ++i) { - char c = _OptString[i]; + char c = text[i]; sint32 w = rVR.getTypoTextureW(c); if ((curLineSize + w) > maxW) {