diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-03-17 14:17:35 +0200 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-03-17 14:17:35 +0200 |
commit | 464092e2c9354c62143f3cbf5503445e6e6fe84e (patch) | |
tree | 537143c506ff4558b25f69643c9a8257a6e6deb6 /indra | |
parent | 632afda4dd8abc5bfc7b3a47d4f7bef44fa2f821 (diff) |
Fixed normal EXT - 6028 ( [HARD CODED]? Inventory > Library > \"Accessories\" folder)
Added localization string to the strings.xml for Accessories folder and localization support of Accessories folder from source code (llfolderviewitem.cpp).
<string name=\"InvFolder Accessories\">TRANSLATION TO THE CORRESPONDING LANGUAGE</string> -- this string should be added to the strings.xml for each locale.
Note: due to Accessories category is created out of viewer & has the FT_NONE type it can not be localized as other protected (system) categories.
So, hack was provided to check this folder (in a Library) & localize it.
Reviewd by Mike Antipov at https://codereview.productengine.com/secondlife/r/42/
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 20 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 72e34594db..bb4c75d3ac 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -255,7 +255,25 @@ void LLFolderViewItem::refreshFromListener() // temporary attempt to display the inventory folder in the user locale. // mantipov: *NOTE: be sure this code is synchronized with LLFriendCardsManager::findChildFolderUUID // it uses the same way to find localized string - if (LLFolderType::lookupIsProtectedType(preferred_type)) + + // HACK: EXT - 6028 ([HARD CODED]? Inventory > Library > "Accessories" folder) + // Translation of Accessories folder in Library inventory folder + bool accessories = false; + if(mLabel == std::string("Accessories")) + { + //To ensure that Accessories folder is in Library we have to check its parent folder. + //Due to parent LLFolderViewFloder is not set to this item yet we have to check its parent via Inventory Model + LLInventoryCategory* cat = gInventory.getCategory(mListener->getUUID()); + if(cat) + { + const LLUUID& parent_folder_id = cat->getParentUUID(); + accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); + } + } + + //"Accessories" inventory category has folder type FT_NONE. So, this folder + //can not be detected as protected with LLFolderType::lookupIsProtectedType + if (accessories || LLFolderType::lookupIsProtectedType(preferred_type)) { LLTrans::findString(mLabel, "InvFolder " + mLabel); }; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index da39f13726..eb45a9765b 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1894,6 +1894,7 @@ Clears (deletes) the media and all params from the given face. <string name="InvFolder favorite">Favorites</string> <string name="InvFolder Current Outfit">Current Outfit</string> <string name="InvFolder My Outfits">My Outfits</string> + <string name="InvFolder Accessories">Accessories</string> <!-- are used for Friends and Friends/All folders in Inventory "Calling cards" folder. See EXT-694--> <string name="InvFolder Friends">Friends</string> |