From ec28b9af16c7f5eb365b945743d85fe75cc8383f Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 11 Aug 2010 20:39:34 +0300 Subject: 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 --- indra/llxuixml/lltrans.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/llxuixml') 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() -- cgit v1.2.3 From 492c189e24242cedd10dca47c31ffddccf200fcc Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 17 Aug 2010 17:10:13 +0300 Subject: EXT-8425 ADDITIONAL FIX Fixed broken translation of accelerators which was introduced by fix of this bug in changeset 14331:11122e1fc5cf. Removed "Key_" prefix from new key strings and from function that finds them, because it broke translation of old accelerator strings. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/861/ --HG-- branch : product-engine --- indra/llxuixml/lltrans.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/lltrans.h b/indra/llxuixml/lltrans.h index 6c8d28b346..84eeef0ace 100644 --- a/indra/llxuixml/lltrans.h +++ b/indra/llxuixml/lltrans.h @@ -107,7 +107,7 @@ public: { std::string key_str(keystring); std::string trans_str; - return findString(trans_str, "Key_" + key_str) ? trans_str : key_str; + return findString(trans_str, key_str) ? trans_str : key_str; } // get the default args -- cgit v1.2.3