summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-03-03 13:23:34 +0200
committerMike Antipov <mantipov@productengine.com>2010-03-03 13:23:34 +0200
commit0e780c9b912913b3eddde251b62f6218df4c5587 (patch)
tree2cd3ca45153ee143fb69e294c680acfed3243905 /indra/newview
parentf7624035c7ada3e240b1370349f9df2854b90833 (diff)
Fixed major subtask (bug) EXT-5829 (Switching language in preferences creates new calling cards folders for each language)
- Reason: Inventory folders (Friends & All) were created WITH localized names. - Fix: create these folders with hard-coded name (like other protected Inventory Folders). They are localized in FolderView --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfriendcard.cpp26
-rw-r--r--indra/newview/llfriendcard.h2
2 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp
index ac060cef15..18f81fe506 100644
--- a/indra/newview/llfriendcard.cpp
+++ b/indra/newview/llfriendcard.cpp
@@ -44,24 +44,28 @@
// Constants;
-static const std::string INVENTORY_STRING_FRIENDS_SUBFOLDER = "InvFolder Friends";
-static const std::string INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER = "InvFolder All";
+static const std::string INVENTORY_STRING_FRIENDS_SUBFOLDER = "Friends";
+static const std::string INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER = "All";
// helper functions
-// NOTE: Usage of LLTrans::getString(); in next two functions to set localized
-// folders' names is caused by a hack in the LLFolderViewItem::refreshFromListener()
-// method for protected asset types.
-// So, localized names will be got from the strings with "InvFolder LABEL_NAME"
-// in the strings.xml
+// NOTE: For now Friends & All folders are created as protected folders of the LLFolderType::FT_CALLINGCARD type.
+// So, their names will be processed in the LLFolderViewItem::refreshFromListener() to be localized
+// using "InvFolder LABEL_NAME" as LLTrans::findString argument.
+
+// We must use in this file their hard-coded names to ensure found them on different locales. EXT-5829.
+// These hard-coded names will be stored in InventoryItems but shown localized in FolderViewItems
+
+// If hack in the LLFolderViewItem::refreshFromListener() to localize protected folder is removed
+// or these folders are not protected these names should be localized in another place/way.
inline const std::string get_friend_folder_name()
{
- return LLTrans::getString(INVENTORY_STRING_FRIENDS_SUBFOLDER);
+ return INVENTORY_STRING_FRIENDS_SUBFOLDER;
}
inline const std::string get_friend_all_subfolder_name()
{
- return LLTrans::getString(INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER);
+ return INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER;
}
void move_from_to_arrays(LLInventoryModel::cat_array_t& from, LLInventoryModel::cat_array_t& to)
@@ -350,9 +354,9 @@ const LLUUID& LLFriendCardsManager::findFriendAllSubfolderUUIDImpl() const
return findChildFolderUUID(friendFolderUUID, friendAllSubfolderName);
}
-const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& localizedName) const
+const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const
{
- LLNameCategoryCollector matchFolderFunctor(localizedName);
+ LLNameCategoryCollector matchFolderFunctor(nonLocalizedName);
return get_folder_uuid(parentFolderUUID, matchFolderFunctor);
}
diff --git a/indra/newview/llfriendcard.h b/indra/newview/llfriendcard.h
index b94d5ec2c0..1cda52c1d7 100644
--- a/indra/newview/llfriendcard.h
+++ b/indra/newview/llfriendcard.h
@@ -120,7 +120,7 @@ private:
return (mBuddyIDSet.end() != mBuddyIDSet.find(avatarID));
}
- const LLUUID& findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& localizedName) const;
+ const LLUUID& findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const;
const LLUUID& findFriendFolderUUIDImpl() const;
const LLUUID& findFriendAllSubfolderUUIDImpl() const;
const LLUUID& findFriendCardInventoryUUIDImpl(const LLUUID& avatarID);