summaryrefslogtreecommitdiff
path: root/indra/llxuixml/lltrans.h
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2010-08-11 20:39:34 +0300
committerAndrew Dyukov <adyukov@productengine.com>2010-08-11 20:39:34 +0300
commitd4f12f2630d41b0dc534c0d3d0d8ae7b3881c680 (patch)
treef9707d9342904db845cfacc6653efdf99be60aa1 /indra/llxuixml/lltrans.h
parent3b4385fe559b5a05d09463d920a8d28a64bc2e03 (diff)
EXT-8425 FIXED Translated names of "Home" and "Esc" keys shown in shortcuts.
Each key has KEY (typedef of U8) represantation which is paired with text version of key. To get strings corresponding to keys LLKeyboard::stringFromKey() is used. - Added translation of keys into LLKeyboard::stringFromKey(). - Added corresponding strings into strings.xml. - Changed LLTrans::getKeyboardString() so that it correctly process key names that are not found in strings.xml(returns English name instead of "MissingString"). Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/845/ --HG-- branch : product-engine
Diffstat (limited to 'indra/llxuixml/lltrans.h')
-rw-r--r--indra/llxuixml/lltrans.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/llxuixml/lltrans.h b/indra/llxuixml/lltrans.h
index 856b9e04fc..6c8d28b346 100644
--- a/indra/llxuixml/lltrans.h
+++ b/indra/llxuixml/lltrans.h
@@ -103,11 +103,12 @@ public:
return findString(result, xml_desc, empty);
}
- static std::string getKeyboardString(const char* keystring)
- {
- // These map directly - no need to specialize
- return getString( ll_safe_string(keystring) );
- }
+ static std::string getKeyboardString(const char* keystring)
+ {
+ std::string key_str(keystring);
+ std::string trans_str;
+ return findString(trans_str, "Key_" + key_str) ? trans_str : key_str;
+ }
// get the default args
static const LLStringUtil::format_map_t& getDefaultArgs()