summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-23 13:56:42 +0200
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-23 13:56:42 +0200
commit6172945775790757af827dfb88251875b0dd446f (patch)
tree40a7009741a94b460d592c811fa16ebe9ec655f8 /indra/newview/llpanelmaininventory.cpp
parentdfbf9e6d96293b7f97553154d103883dede477b8 (diff)
SL-19391 FIXED SFV floater title displays unlocalised name for system folders
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp55
1 files changed, 37 insertions, 18 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index e60ee20210..23a32df2cc 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -53,6 +53,7 @@
#include "llspinctrl.h"
#include "lltoggleablemenu.h"
#include "lltooldraganddrop.h"
+#include "lltrans.h"
#include "llviewermenu.h"
#include "llviewertexturelist.h"
#include "llsidepanelinventory.h"
@@ -763,11 +764,7 @@ void LLPanelMainInventory::onFilterSelected()
finder->changeFilter(&filter);
if (mSingleFolderMode)
{
- const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot());
- if (cat)
- {
- finder->setTitle(cat->getName());
- }
+ finder->setTitle(getLocalizedRootName());
}
}
if (filter.isActive())
@@ -934,11 +931,7 @@ void LLPanelMainInventory::toggleFindOptions()
if (mSingleFolderMode)
{
- const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot());
- if (cat)
- {
- finder->setTitle(cat->getName());
- }
+ finder->setTitle(getLocalizedRootName());
}
}
else
@@ -1925,15 +1918,11 @@ void LLPanelMainInventory::updateTitle()
{
if(mSingleFolderMode)
{
- const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot());
- if (cat)
+ inventory_floater->setTitle(getLocalizedRootName());
+ LLFloaterInventoryFinder *finder = getFinder();
+ if (finder)
{
- inventory_floater->setTitle(cat->getName());
- LLFloaterInventoryFinder *finder = getFinder();
- if (finder)
- {
- finder->setTitle(cat->getName());
- }
+ finder->setTitle(getLocalizedRootName());
}
}
else
@@ -2004,6 +1993,36 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
}
}
+std::string LLPanelMainInventory::getLocalizedRootName()
+{
+ std::string localized_root_name;
+ if(mSingleFolderMode)
+ {
+ const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot());
+ if (cat)
+ {
+ LLFolderType::EType preferred_type = cat->getPreferredType();
+
+ // Translation of Accessories folder in Library inventory folder
+ bool accessories = false;
+ if(getName() == "Accessories")
+ {
+ 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
+ localized_root_name.assign(cat->getName());
+ if (accessories || LLFolderType::lookupIsProtectedType(preferred_type))
+ {
+ LLTrans::findString(localized_root_name, std::string("InvFolder ") + cat->getName(), LLSD());
+ }
+ }
+ }
+ return localized_root_name;
+}
+
LLUUID LLPanelMainInventory::getCurrentSFVRoot()
{
if(isListViewMode())