From c5356935354013530432cfb07556902a039020a9 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 12 Jul 2010 17:32:03 -0400 Subject: EXT-8333 FIXED 'Add more': 'Wear' item remains enabled in context menu of worn object Simple logic fix so that worn objects son't have add/wear option. --- indra/newview/llwearableitemslist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 60ebb9416e..35abbc0c4d 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -765,8 +765,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu bool standalone = mParent ? mParent->isStandalone() : false; // *TODO: eliminate multiple traversals over the menu items - setMenuItemVisible(menu, "wear_wear", n_already_worn == 0); - setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0); + setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); + setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0); setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0); setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0); -- cgit v1.2.3 From 756b010f7ca9fa31922ccbbff843dba2e1c1fed3 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 14 Jul 2010 15:01:30 +0300 Subject: EXT-8318 FIXED Fixed wrong (hardcoded) locale usage to format number of inventory items in the Inventory SP. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/752/ --HG-- branch : product-engine --- indra/newview/llpanelmaininventory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 3e12f0ba9a..56b73fe55b 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -567,7 +567,8 @@ void LLPanelMainInventory::draw() void LLPanelMainInventory::updateItemcountText() { - LLLocale locale(LLLocale::USER_LOCALE); + // *TODO: Calling setlocale() on each frame may be inefficient. + LLLocale locale(LLStringUtil::getLocale()); std::string item_count_string; LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); -- cgit v1.2.3 From 8b09f20d7dc6c476bcba83f5932f9d18b66ef507 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 14 Jul 2010 15:05:28 +0300 Subject: EXT-8310 FIXED Incorrect currency format in the Buy L$ floater. Changes in the Buy L$ floater: * Set system locale before formatting currency. * Made money format configurable (via strings.xml). * Placed the "L$" label to the right of the line editor in FR locale. Details: Actually, the proper way to fix this and similar number formatting bugs would be to set the system locale at startup, but: 1. That triggers assertions when parsing locale-agnostic XML files like avatar_skeleton.xml. 2. I'm wary of making such global changes so close to the 2.1 release. Therefore I just temporarily override current locale before formatting a number and restore the previous locale afterwards. Reviewed by Tofu at https://codereview.productengine.com/secondlife/r/751/ --HG-- branch : product-engine --- indra/newview/llcurrencyuimanager.cpp | 9 ++++++++- indra/newview/skins/default/xui/en/strings.xml | 3 +++ indra/newview/skins/default/xui/fr/floater_buy_currency.xml | 4 ++-- indra/newview/skins/default/xui/fr/strings.xml | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index fd3df359bd..7ebcef943e 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -35,6 +35,8 @@ #include "lluictrlfactory.h" #include "lltextbox.h" #include "lllineeditor.h" +#include "llresmgr.h" // for LLLocale +#include "lltrans.h" #include "llviewercontrol.h" #include "llversioninfo.h" @@ -323,7 +325,12 @@ std::string LLCurrencyUIManager::Impl::getLocalEstimate() const if (mUSDCurrencyEstimated) { // we have the old-style USD-specific value - return "US$ " + llformat("%#.2f", mUSDCurrencyEstimatedCost / 100.0); + LLStringUtil::format_map_t args; + { + LLLocale locale_override(LLStringUtil::getLocale()); + args["[AMOUNT]"] = llformat("%#.2f", mUSDCurrencyEstimatedCost / 100.0); + } + return LLTrans::getString("LocalEstimateUSD", args); } return ""; } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b91acbe27d..dfca765783 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3222,4 +3222,7 @@ Abuse Report [MDAY] AM PM + + + US$ [AMOUNT] diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml index 4eaff8535e..b3acc83078 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml @@ -22,10 +22,10 @@ le Lindex... Je veux acheter - + L$ - + 1234 diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index f8da908cff..e6da5f4a3d 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -3817,4 +3817,5 @@ de l'infraction signalée PM + [AMOUNT] US$ -- cgit v1.2.3 From 0f169e180667175ba298f8fdf1e7a45db70d89fd Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Wed, 14 Jul 2010 16:10:21 +0300 Subject: EXT-7880 FIXED (Classifieds and Picks placeholders show old gray X) - Classified and Picks related panels now use default land image as their own default picture. - Also Profile related panels fixed with generic person icon (some of them had the same grey X instead of image). Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/745/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_classified.xml | 1 + indra/newview/skins/default/xui/en/panel_classified_info.xml | 1 + indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_classified.xml | 1 + indra/newview/skins/default/xui/en/panel_edit_pick.xml | 1 + indra/newview/skins/default/xui/en/panel_my_profile.xml | 1 + indra/newview/skins/default/xui/en/panel_pick_info.xml | 1 + indra/newview/skins/default/xui/en/panel_pick_list_item.xml | 2 +- 8 files changed, 8 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_classified.xml b/indra/newview/skins/default/xui/en/panel_classified.xml index c8293d3663..e96dbd527c 100644 --- a/indra/newview/skins/default/xui/en/panel_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_classified.xml @@ -25,6 +25,7 @@ [mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt] Date: Wed, 14 Jul 2010 16:25:17 +0300 Subject: EXT-8319 FIXED Added method to localize inventory categories having predefined names, updated predefined keys for "Male - Get lost" and "Female - Get lost". There were two issues: * "Male - Get lost" and "Female - Get lost" gestures have by 2 spaces before "-" in their names. * Folders were not processed to be localize. This was not implemented correctly in EXT-7051. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/753/ --HG-- branch : product-engine --- indra/newview/llinventorymodel.cpp | 3 +++ indra/newview/llviewerinventory.cpp | 43 ++++++++++++++++++++++++++----------- indra/newview/llviewerinventory.h | 5 +++++ 3 files changed, 38 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 236ed9bbd1..13e5cb516e 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1254,6 +1254,9 @@ void LLInventoryModel::addCategory(LLViewerInventoryCategory* category) //llinfos << "LLInventoryModel::addCategory()" << llendl; if(category) { + // try to localize default names first. See EXT-8319, EXT-7051. + category->localizeName(); + // Insert category uniquely into the map mCategoryMap[category->getUUID()] = category; // LLPointer will deref and delete the old one //mInventory[category->getUUID()] = category; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index cbc86c89cc..bea21931bd 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -67,7 +67,7 @@ #include "llsidepanelappearance.h" ///---------------------------------------------------------------------------- -/// Helper class to store special inventory item names +/// Helper class to store special inventory item names and their localized values. ///---------------------------------------------------------------------------- class LLLocalizedInventoryItemsDictionary : public LLSingleton { @@ -108,7 +108,7 @@ public: //male mInventoryItemsDict["Male - Excuse me"] = LLTrans::getString("Male - Excuse me"); - mInventoryItemsDict["Male - Get lost"] = LLTrans::getString("Male - Get lost"); + mInventoryItemsDict["Male - Get lost"] = LLTrans::getString("Male - Get lost"); // double space after Male. EXT-8319 mInventoryItemsDict["Male - Blow kiss"] = LLTrans::getString("Male - Blow kiss"); mInventoryItemsDict["Male - Boo"] = LLTrans::getString("Male - Boo"); mInventoryItemsDict["Male - Bored"] = LLTrans::getString("Male - Bored"); @@ -121,7 +121,7 @@ public: //female mInventoryItemsDict["Female - Excuse me"] = LLTrans::getString("Female - Excuse me"); - mInventoryItemsDict["Female - Get lost"] = LLTrans::getString("Female - Get lost"); + mInventoryItemsDict["Female - Get lost"] = LLTrans::getString("Female - Get lost"); // double space after Female. EXT-8319 mInventoryItemsDict["Female - Blow kiss"] = LLTrans::getString("Female - Blow kiss"); mInventoryItemsDict["Female - Boo"] = LLTrans::getString("Female - Boo"); mInventoryItemsDict["Female - Bored"] = LLTrans::getString("Female - Bored"); @@ -133,6 +133,27 @@ public: mInventoryItemsDict["Female - Wow"] = LLTrans::getString("Female - Wow"); } + + /** + * Finds passed name in dictionary and replaces it with found localized value. + * + * @param object_name - string to be localized. + * @return true if passed name was found and localized, false otherwise. + */ + bool localizeInventoryObjectName(std::string& object_name) + { + LL_DEBUGS("InventoryLocalize") << "Searching for localization: " << object_name << LL_ENDL; + + std::map::const_iterator dictionary_iter = mInventoryItemsDict.find(object_name); + + bool found = dictionary_iter != mInventoryItemsDict.end(); + if(found) + { + object_name = dictionary_iter->second; + LL_DEBUGS("InventoryLocalize") << "Found, new name is: " << object_name << LL_ENDL; + } + return found; + } }; @@ -391,16 +412,7 @@ BOOL LLViewerInventoryItem::unpackMessage(LLMessageSystem* msg, const char* bloc { BOOL rv = LLInventoryItem::unpackMessage(msg, block, block_num); - std::string localized_str; - - std::map::const_iterator dictionary_iter; - - dictionary_iter = LLLocalizedInventoryItemsDictionary::getInstance()->mInventoryItemsDict.find(mName); - - if(dictionary_iter != LLLocalizedInventoryItemsDictionary::getInstance()->mInventoryItemsDict.end()) - { - mName = dictionary_iter->second; - } + LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); mIsComplete = TRUE; return rv; @@ -820,6 +832,11 @@ void LLViewerInventoryCategory::changeType(LLFolderType::EType new_folder_type) gInventory.addChangedMask(LLInventoryObserver::LABEL, folder_id); } +void LLViewerInventoryCategory::localizeName() +{ + LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); +} + ///---------------------------------------------------------------------------- /// Local function definitions ///---------------------------------------------------------------------------- diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 1dd6597388..ef3586537b 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -229,6 +229,11 @@ public: bool importFileLocal(LLFILE* fp); void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); + +private: + friend class LLInventoryModel; + void localizeName(); // intended to be called from the LLInventoryModel + protected: LLUUID mOwnerID; S32 mVersion; -- cgit v1.2.3 From 706e75dff3afafbec9dd6ca2266c8b6c1bdb6689 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 14 Jul 2010 16:36:00 +0300 Subject: EXT-8003 FIXED Changed "short" form of overriding widget's nested params with "long" one for accordions. * for My Outfits panel * for Teleport History panel Unfortunately this is required to enable automatization of translation with VLT. NOTE: both "long" and "short" forms can be localized properly. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/740/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_outfits_list.xml | 10 +++++++--- indra/newview/skins/default/xui/en/panel_teleport_history.xml | 8 ++++++-- indra/newview/skins/default/xui/en/widgets/accordion.xml | 6 ++++++ 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml index d18f0d57ca..9833b1dccb 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml @@ -14,9 +14,6 @@ background_visible="true" bg_alpha_color="DkGray2" bg_opaque_color="DkGray2" - no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]." - no_matched_tabs_text.v_pad="10" - no_visible_tabs_text.value="You don't have any outfits yet. Try [secondlife:///app/search/all/ Search]" follows="all" height="400" layout="topleft" @@ -24,6 +21,13 @@ name="outfits_accordion" top="0" width="309"> + + + + + Date: Wed, 14 Jul 2010 18:18:47 +0300 Subject: EXT-8400 FIXED Updated default inventory item names ("New Script", etc) on viewer language switch. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug reason ========== New inventory items get names like "New Script", "New Undershirt" etc., but the names are translated on-the-fly (see EXT-5839), so the user actually sees "Nouveau script", "Nouveau débardeur" etc., respectively. However when the user changes viewer language, the old localized names still exist in the inventory cache, so, for example, if you create an undershirt in French and then switch to Enlgish, the undershirt will be named "Nouveau d bardeur", which is the old cached localized name with non-ASCII characters replaced with spaces. Fix === To get rid of obsolete translations I clear all caches whenever viewer language gets changed. Other changes ============= - Added a check for agent region being NULL to LLAgentLanguage::update(). - Removed LLAgentLanguage constructor and base classes because it's never instantiated. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/744/ --HG-- branch : product-engine --- indra/newview/llagentlanguage.cpp | 26 ++++++++++++++++++++------ indra/newview/llagentlanguage.h | 10 +++++----- indra/newview/llappviewer.cpp | 3 +++ 3 files changed, 28 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentlanguage.cpp b/indra/newview/llagentlanguage.cpp index e97f136489..3d4e34a549 100644 --- a/indra/newview/llagentlanguage.cpp +++ b/indra/newview/llagentlanguage.cpp @@ -39,21 +39,35 @@ // library includes #include "llui.h" // getLanguage() -LLAgentLanguage::LLAgentLanguage() +// static +void LLAgentLanguage::init() { - gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&update)); - gSavedSettings.getControl("InstallLanguage")->getSignal()->connect(boost::bind(&update)); - gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&update)); - gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&update)); + gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&onChange)); + gSavedSettings.getControl("InstallLanguage")->getSignal()->connect(boost::bind(&onChange)); + gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&onChange)); + gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&onChange)); } +// static +void LLAgentLanguage::onChange() +{ + // Clear inventory cache so that default names of inventory items + // appear retranslated (EXT-8308). + gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); +} // send language settings to the sim // static bool LLAgentLanguage::update() { LLSD body; - std::string url = gAgent.getRegion()->getCapability("UpdateAgentLanguage"); + std::string url; + + if (gAgent.getRegion()) + { + url = gAgent.getRegion()->getCapability("UpdateAgentLanguage"); + } + if (!url.empty()) { std::string language = LLUI::getLanguage(); diff --git a/indra/newview/llagentlanguage.h b/indra/newview/llagentlanguage.h index 45348a1e50..d7e6f3c6c7 100644 --- a/indra/newview/llagentlanguage.h +++ b/indra/newview/llagentlanguage.h @@ -33,14 +33,14 @@ #ifndef LL_LLAGENTLANGUAGE_H #define LL_LLAGENTLANGUAGE_H -#include "llsingleton.h" // LLSingleton<> -#include "llevent.h" - -class LLAgentLanguage: public LLSingleton, public LLOldEvents::LLSimpleListener +class LLAgentLanguage { public: - LLAgentLanguage(); + static void init(); static bool update(); + + private: + static void onChange(); }; #endif // LL_LLAGENTLANGUAGE_H diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 682e3eb874..6869cf3e64 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -45,6 +45,7 @@ #include "llgroupmgr.h" #include "llagent.h" #include "llagentcamera.h" +#include "llagentlanguage.h" #include "llagentwearables.h" #include "llwindow.h" #include "llviewerstats.h" @@ -946,6 +947,8 @@ bool LLAppViewer::init() LLStringOps::sPM = LLTrans::getString("dateTimePM"); } + LLAgentLanguage::init(); + return true; } -- cgit v1.2.3 From 2acfe2547a45cb15420c5dad18d4e4e2e83f05a5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 14 Jul 2010 17:36:13 +0100 Subject: EXT-7455 PARTIAL viewer crash in LLSurface::getWaterHeight Somewhere between a band-aid and a real fix. Entirely speculative since there is no repro. --- indra/newview/llsurface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index ddb5d08e07..cecc135951 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -158,6 +158,7 @@ void LLSurface::initClasses() void LLSurface::setRegion(LLViewerRegion *regionp) { mRegionp = regionp; + mWaterObjp = NULL; // depends on regionp, needs recreating } // Assumes that arguments are powers of 2, and that @@ -958,6 +959,7 @@ LLSurfacePatch *LLSurface::resolvePatchRegion(const LLVector3 &pos_region) const LLSurfacePatch *LLSurface::resolvePatchGlobal(const LLVector3d &pos_global) const { + llassert(mRegionp); LLVector3 pos_region = mRegionp->getPosRegionFromGlobal(pos_global); return resolvePatchRegion(pos_region); } -- cgit v1.2.3 From ac0046301c98c7b434143f17bfb16eac843a09ca Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 14 Jul 2010 19:40:09 +0300 Subject: EXT-8361 FIXED Set a name for a nameless parent panel. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/755/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/da/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/de/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/en/panel_nearby_media.xml | 1 + indra/newview/skins/default/xui/es/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/fr/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/it/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/ja/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/pl/panel_nearby_media.xml | 2 +- indra/newview/skins/default/xui/pt/panel_nearby_media.xml | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/da/panel_nearby_media.xml b/indra/newview/skins/default/xui/da/panel_nearby_media.xml index 95bfc89f20..9b8b70bb34 100644 --- a/indra/newview/skins/default/xui/da/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/da/panel_nearby_media.xml @@ -36,7 +36,7 @@ - +