diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp index b43554409..e7e6575de 100644 --- a/indra/llcharacter/llmultigesture.cpp +++ b/indra/llcharacter/llmultigesture.cpp @@ -44,6 +44,7 @@ const S32 GESTURE_VERSION = 2; LLMultiGesture::LLMultiGesture() : mKey(), mMask(), + mName(), mTrigger(), mReplaceText(), mSteps(), @@ -286,20 +287,27 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepAnimation::getLabel() const +// *NOTE: result is translated in LLPreviewGesture::getLabel() +std::vector LLGestureStepAnimation::getLabel() const { - std::string label; + std::vector strings; + +// std::string label; if (mFlags & ANIM_FLAG_STOP) { - label = "Stop Animation: "; + strings.push_back( "AnimFlagStop"); + +// label = "Stop Animation: "; } else { - label = "Start Animation: "; + strings.push_back( "AnimFlagStart"); + +// label = "Start Animation: "; } - label += mAnimName; - return label; + strings.push_back( mAnimName); +// label += mAnimName; + return strings; } void LLGestureStepAnimation::dump() @@ -353,12 +361,15 @@ BOOL LLGestureStepSound::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepSound::getLabel() const +// *NOTE: result is translated in LLPreviewGesture::getLabel() +std::vector LLGestureStepSound::getLabel() const { - std::string label("Sound: "); - label += mSoundName; - return label; + std::vector strings; + strings.push_back( "Sound"); + strings.push_back( mSoundName); +// std::string label("Sound: "); +// label += mSoundName; + return strings; } void LLGestureStepSound::dump() @@ -408,12 +419,13 @@ BOOL LLGestureStepChat::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepChat::getLabel() const +// *NOTE: result is translated in LLPreviewGesture::getLabel() +std::vector LLGestureStepChat::getLabel() const { - std::string label("Chat: "); - label += mChatText; - return label; + std::vector strings; + strings.push_back("Chat"); + strings.push_back(mChatText); + return strings; } void LLGestureStepChat::dump() @@ -461,22 +473,31 @@ BOOL LLGestureStepWait::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepWait::getLabel() const +// *NOTE: result is translated in LLPreviewGesture::getLabel() +std::vector LLGestureStepWait::getLabel() const { - std::string label("--- Wait: "); + std::vector strings; + strings.push_back( "Wait" ); + +// std::string label("--- Wait: "); if (mFlags & WAIT_FLAG_TIME) { char buffer[64]; /* Flawfinder: ignore */ snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */ - label += buffer; + strings.push_back(buffer); +// label += buffer; } else if (mFlags & WAIT_FLAG_ALL_ANIM) { - label += "until animations are done"; + strings.push_back("until animations are done"); + // label += "until animations are done"; + } + else + { + strings.push_back(""); } - return label; + return strings; } diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index 0d1c652f9..0c027b31b 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -134,7 +134,7 @@ public: virtual EStepType getType() = 0; // Return a user-readable label for this step - virtual std::string getLabel() const = 0; + virtual std::vector getLabel() const = 0; virtual S32 getMaxSerialSize() const = 0; virtual BOOL serialize(LLDataPacker& dp) const = 0; @@ -156,7 +156,7 @@ public: virtual EStepType getType() { return STEP_ANIMATION; } - virtual std::string getLabel() const; + virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; @@ -179,7 +179,7 @@ public: virtual EStepType getType() { return STEP_SOUND; } - virtual std::string getLabel() const; + virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; @@ -202,7 +202,7 @@ public: virtual EStepType getType() { return STEP_CHAT; } - virtual std::string getLabel() const; + virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; @@ -227,7 +227,7 @@ public: virtual EStepType getType() { return STEP_WAIT; } - virtual std::string getLabel() const; + virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 5a47eaf25..5991cba8e 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -911,6 +911,21 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) return NULL; } +// Helper function for LLGroupMgr::processGroupMembersReply +// This reformats date strings from MM/DD/YYYY to YYYY/MM/DD ( e.g. 1/27/2008 -> 2008/1/27 ) +// so that the sorter can sort by year before month before day. +static void formatDateString(std::string &date_string) +{ + tm t; + if (sscanf(date_string.c_str(), "%u/%u/%u", &t.tm_mon, &t.tm_mday, &t.tm_year) == 3 && t.tm_year > 1900) + { + t.tm_year -= 1900; + t.tm_mon--; + t.tm_hour = t.tm_min = t.tm_sec = 0; + timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), date_string); + } +} + // static void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) { @@ -960,13 +975,14 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) if (member_id.notNull()) { - tm t; - if (sscanf(online_status.c_str(), "%u/%u/%u", &t.tm_mon, &t.tm_mday, &t.tm_year) == 3 && t.tm_year > 1900) + if (online_status == "Online") { - t.tm_year -= 1900; - t.tm_mon--; - t.tm_hour = t.tm_min = t.tm_sec = 0; - timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), online_status); + static std::string localized_online(LLTrans::getString("group_member_status_online")); + online_status = localized_online; + } + else + { + formatDateString(online_status); // reformat for sorting, e.g. 12/25/2008 -> 2008/12/25 } //llinfos << "Member " << member_id << " has powers " << std::hex << agent_powers << std::dec << llendl; @@ -1127,6 +1143,22 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) msg->getU64("RoleData","Powers",powers,i); msg->getU32("RoleData","Members",member_count,i); + //there are 3 predifined roles - Owners, Officers, Everyone + //there names are defined in lldatagroups.cpp + //lets change names from server to localized strings + if(name == "Everyone") + { + name = LLTrans::getString("group_role_everyone"); + } + else if(name == "Officers") + { + name = LLTrans::getString("group_role_officers"); + } + else if(name == "Owners") + { + name = LLTrans::getString("group_role_owners"); + } + lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl; LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count); group_datap->mRoles[role_id] = rd; diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index b94f0787a..ecb260704 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -44,6 +44,7 @@ #include "lldir.h" #include "llmultigesture.h" #include "llvfile.h" +#include "lltrans.h" // newview #include "llagent.h" // todo: remove @@ -862,7 +863,7 @@ void LLPreviewGesture::initDefaultGesture() item = addStep( STEP_ANIMATION ); LLGestureStepAnimation* anim = (LLGestureStepAnimation*)item->getUserdata(); anim->mAnimAssetID = ANIM_AGENT_HELLO; - anim->mAnimName = "Wave"; + anim->mAnimName = LLTrans::getString("Wave"); updateLabel(item); item = addStep( STEP_WAIT ); @@ -872,7 +873,7 @@ void LLPreviewGesture::initDefaultGesture() item = addStep( STEP_CHAT ); LLGestureStepChat* chat_step = (LLGestureStepChat*)item->getUserdata(); - chat_step->mChatText = "Hello, avatar!"; + chat_step->mChatText = LLTrans::getString("HelloAvatar"); updateLabel(item); // Start with item list selected @@ -1084,7 +1085,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture) // Create an enabled item with this step LLSD row; - row["columns"][0]["value"] = new_step->getLabel(); + row["columns"][0]["value"] = getLabel( new_step->getLabel()); row["columns"][0]["font"] = "SANSSERIF_SMALL"; LLScrollListItem* item = mStepList->addElement(row); item->setUserdata(new_step); @@ -1400,7 +1401,7 @@ void LLPreviewGesture::updateLabel(LLScrollListItem* item) LLScrollListCell* cell = item->getColumn(0); LLScrollListText* text_cell = (LLScrollListText*)cell; - std::string label = step->getLabel(); + std::string label = getLabel( step->getLabel()); text_cell->setText(label); } @@ -1662,7 +1663,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) // Create an enabled item with this step LLSD row; - row["columns"][0]["value"] = step->getLabel(); + row["columns"][0]["value"] = getLabel(step->getLabel()); row["columns"][0]["font"] = "SANSSERIF_SMALL"; LLScrollListItem* step_item = mStepList->addElement(row); step_item->setUserdata(step); @@ -1676,6 +1677,63 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) return step_item; } +// static +std::string LLPreviewGesture::getLabel(std::vector labels) +{ + std::vector v_labels = labels ; + std::string result(""); + + if( v_labels.size() != 2) + { + return result; + } + + if(v_labels[0]=="Chat") + { + result=LLTrans::getString("Chat Message"); + } + else if(v_labels[0]=="Sound") + { + result=LLTrans::getString("Sound"); + } + else if(v_labels[0]=="Wait") + { + result=LLTrans::getString("Wait"); + } + else if(v_labels[0]=="AnimFlagStop") + { + result=LLTrans::getString("AnimFlagStop"); + } + else if(v_labels[0]=="AnimFlagStart") + { + result=LLTrans::getString("AnimFlagStart"); + } + + // lets localize action value + std::string action = v_labels[1]; + if ("None" == action) + { + action = LLTrans::getString("GestureActionNone"); + } + else if ("until animations are done" == action) + { + //action = LLFloaterReg::getInstance("preview_gesture")->getChild("wait_anim_check")->getLabel(); + //Worst. Thing. Ever. We are in a static function. Find any existing gesture preview and grab the label from its 'wait_anim_check' element. + for(preview_map_t::iterator it = LLPreview::sInstances.begin(); it != LLPreview::sInstances.end();++it) + { + LLPreviewGesture* pPreview = dynamic_cast(it->second); + if(pPreview) + { + pPreview->getChild("wait_anim_check")->getLabel(); + break; + } + } + + } + result.append(action); + return result; + +} // static void LLPreviewGesture::onClickUp(void* data) { diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index e2cc50bb3..8434a46e5 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -113,6 +113,7 @@ protected: // "Sound", "Chat", or "Wait" LLScrollListItem* addStep(const enum EStepType step_type); + static std::string getLabel(std::vector labels); static void updateLabel(LLScrollListItem* item); static void onCommitSetDirty(LLUICtrl* ctrl, void* data); diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index 6a10b6079..e2cf96e5d 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -1835,6 +1835,18 @@ Returns a key that is the UUID of the user seated on the prim. + + + + + + + + + + + + Stone Metal Glass @@ -1912,6 +1924,12 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. If you continue to receive this message, contact the [SUPPORT_SITE]. + + Everyone + Officers + Owners + Online + osSetRegionWaterHeight(float height)