diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-16 17:39:32 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-16 17:39:32 +0000 |
commit | 3bb628ff73c0cd06dc374c29db9f56d5f5ab283a (patch) | |
tree | aec7ced6a886bd19fbc2c39147ff5be95d864d5f /indra/newview/llpanellandmarkinfo.cpp | |
parent | b6e11798acf6d0539211723e566be7f6145ac138 (diff) | |
parent | a5d1a7b1bac43a4aa88aa647b040a21ca951c682 (diff) |
merge from viewer-2-0
Diffstat (limited to 'indra/newview/llpanellandmarkinfo.cpp')
-rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 56d52ccc65..143a64d08b 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -383,22 +383,41 @@ std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCatego if (cat) { name = cat->getName(); - - // translate category name, if it's right below the root - // FIXME: it can throw notification about non existent string in strings.xml - if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID()) - { - LLTrans::findString(name, "InvFolder " + name); - } + parent_id = cat->getParentUUID(); + bool is_under_root_category = parent_id == gInventory.getRootFolderID(); // we don't want "My Inventory" to appear in the name - while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID()) + while ((parent_id = cat->getParentUUID()).notNull()) { cat = gInventory.getCategory(parent_id); llassert(cat); if (cat) { - name = cat->getName() + "/" + name; + if (is_under_root_category || cat->getParentUUID() == gInventory.getRootFolderID()) + { + std::string localized_name; + if (is_under_root_category) + { + // translate category name, if it's right below the root + // FIXME: it can throw notification about non existent string in strings.xml + bool is_found = LLTrans::findString(localized_name, "InvFolder " + name); + name = is_found ? localized_name : name; + } + else + { + // FIXME: it can throw notification about non existent string in strings.xml + bool is_found = LLTrans::findString(localized_name, "InvFolder " + cat->getName()); + + // add translated category name to folder's full name + name = (is_found ? localized_name : cat->getName()) + "/" + name; + } + + break; + } + else + { + name = cat->getName() + "/" + name; + } } } } |