From 3d46baae459784f5377b5f92ebc0d38e698500f8 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 5 Oct 2015 17:25:33 -0400 Subject: [PATCH] Make Linux happy. And finish FIXME in tabcontainer to remove hardcoded strings. Translators: Please translatetab_tooltip_prev and tab_tooltip_next in strings.xml --- indra/llui/llaccordionctrl.h | 7 ++++--- indra/llui/lltabcontainer.cpp | 14 +++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index 0312344bac..95e321df35 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -64,7 +64,7 @@ class LLAccordionCtrl: public LLPanel virtual bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const = 0; }; - /* Singu TODO: LLPanel::Params, LLTextBox::Params + #if 0 // Singu TODO: LLPanel::Params, LLTextBox::Params struct Params : public LLInitParam::Block { @@ -73,7 +73,7 @@ class LLAccordionCtrl: public LLPanel accordion tabs are responsible for scrolling their content. *NOTE fit_parent works best when combined with single_expansion. Accordion view should implement getRequiredRect() and provide valid height*/ - /*Optional no_matched_tabs_text; + Optional no_matched_tabs_text; Optional no_visible_tabs_text; Params() @@ -84,7 +84,8 @@ class LLAccordionCtrl: public LLPanel {}; }; - LLAccordionCtrl(const Params& params);*/ + LLAccordionCtrl(const Params& params); + #endif LLAccordionCtrl(); virtual ~LLAccordionCtrl(); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 4f16866604..a86527f56f 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -40,6 +40,7 @@ #include "llresmgr.h" #include "llresizehandle.h" #include "lltextbox.h" +#include "lltrans.h" #include "llcriticaldamp.h" #include "lluictrlfactory.h" #include "llrender.h" @@ -873,9 +874,16 @@ void LLTabContainer::addTabPanel(LLPanel* child, } } std::string tooltip = trimmed_label; - // FIXME: Tooltip can not be translated when hardcoded. - tooltip += "\nAlt-Left arrow for previous tab"; - tooltip += "\nAlt-Right arrow for next tab"; + LLStringUtil::format_map_t args; + args["[ALT]"] = LLTrans::getString( +#ifdef LL_DARWIN + "accel-mac-option" +#else + "accel-win-alt" +#endif + ); + tooltip += '\n' + LLTrans::getString("tab_tooltip_prev", args); + tooltip += '\n' + LLTrans::getString("tab_tooltip_next", args); btn->setToolTip( tooltip ); }