diff --git a/indra/newview/llfloaterscriptrecover.cpp b/indra/newview/llfloaterscriptrecover.cpp
index 874c7f5259..41cd1f2641 100644
--- a/indra/newview/llfloaterscriptrecover.cpp
+++ b/indra/newview/llfloaterscriptrecover.cpp
@@ -25,6 +25,7 @@
#include "llinventorymodel.h"
#include "llinventorypanel.h"
#include "llscrolllistctrl.h"
+#include "lltrans.h"
#include "llviewerassettype.h"
#include "llviewerinventory.h"
#include "llviewerregion.h"
@@ -159,13 +160,30 @@ void LLScriptRecoverQueue::recoverIfNeeded()
{
// Build a friendly name for the file
std::string strName = gDirUtilp->getBaseFileName(strFilename, true);
+
+ std::string agent_id_str = gAgentID.asString();
+ LLStringUtil::replaceString(agent_id_str, "-", "");
+ std::string::size_type agent_delim_offset = strName.find_first_of("_");
+ if (agent_delim_offset != std::string::npos && agent_delim_offset != 0)
+ {
+ std::string file_agent_id_str = strName.substr(0, agent_delim_offset);
+ if (file_agent_id_str != agent_id_str)
+ {
+ continue;
+ }
+ else
+ {
+ strName.erase(0, agent_delim_offset + 1);
+ }
+ }
+
std::string::size_type offset = strName.find_last_of("-");
if ( (std::string::npos != offset) && (offset != 0) && (offset == strName.length() - 9))
strName.erase(strName.length() - 9);
LLStringUtil::trim(strName);
if (0 == strName.length())
- strName = "(Unknown script)";
+ strName = LLTrans::getString("unknown_script");
sdFiles.append(LLSD().with("path", strTempPath + strFilename).with("name", strName));
}
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index c3bcfcfda4..d51008b7f4 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2022,6 +2022,10 @@ std::string LLScriptEdContainer::getBackupFileName() const
// NOTE: this function is not guaranteed to return the same filename every time (i.e. the item name may have changed)
std::string strFile = LLFile::tmpdir();
+ std::string agent_id_str = gAgentID.asString();
+ LLStringUtil::replaceString(agent_id_str, "-", "");
+ strFile += agent_id_str + "_";
+
// Find the inventory item for this script
const LLInventoryItem* pItem = getItem();
if (pItem)
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 0584113452..6044c8dd3c 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -7096,4 +7096,7 @@ Ihre aktuelle Position: [AVATAR_POS]
Foto für Outfit
+
+ (Unbekanntes Skript)
+
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 39b088a8a2..cf64cffd9b 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3191,4 +3191,5 @@ Your current position: [AVATAR_POS]
No
Wear inventory folder
Picture for Outfit
+ (Unknown script)