Implemented normal task (EXT-6251) [HARD CODED]? Side bar: Landmarks > + button > Create Landmark > Landmark location dropdown > Landmarks/Japanese.

Normal task (EXT-6251) [HARD CODED]? Side bar: Landmarks > + button > Create Landmark > Landmark location dropdown > Landmarks/Japanese.

Reviewed by Richard Nelson https://codereview.productengine.com/secondlife/r/32/

--HG--
branch : product-engine
master
Sergei Litovchuk 2010-03-16 14:30:30 +02:00
parent 28b1264c57
commit 5bfb3d5c26
1 changed files with 28 additions and 9 deletions

View File

@ -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;
}
}
}
}