Translation Request: Make marketplace received translatable

This commit is contained in:
Lirusaito
2019-03-23 08:37:57 -04:00
parent 0cf4663c7d
commit 1cc7c6b4cf
2 changed files with 14 additions and 0 deletions

View File

@@ -2241,6 +2241,7 @@ void autoresponder_finish(bool show_autoresponded, const LLUUID& session_id, con
}
}
#include <boost/algorithm/string/predicate.hpp>
const std::string NOT_ONLINE_MSG("User not online - message will be stored and delivered later.");
const std::string NOT_ONLINE_INVENTORY("User not online - inventory has been saved.");
void translate_if_needed(std::string& message)
@@ -2253,6 +2254,16 @@ void translate_if_needed(std::string& message)
{
message = LLTrans::getString("not_online_inventory");
}
else if (boost::algorithm::ends_with(message, "Received Items folder."))
{
boost::smatch match;
const boost::regex gift_exp("^You've received a gift! (.*) has given you \\\"(.*)\\\", and says \\\"(.*)\\\"\\. You can find your gift in your Received Items folder\\.$");
bool gift = boost::regex_match(message, match, gift_exp);
if (gift || boost::regex_match(message, match, boost::regex("^Your purchase of (.*) has been delivered to your Received Items folder\\.$")))
message = LLTrans::getString(gift ? "ReceivedGift" : "ReceivedPurchase",
gift ? LLSD().with("USER", match[1].str()).with("PRODUCT", match[2].str()).with("MESSAGE", match[3].str())
: LLSD().with("PRODUCT", match[1].str()));
}
}
void process_improved_im(LLMessageSystem *msg, void **user_data)

View File

@@ -4237,6 +4237,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="not_online_msg">User not online - message will be stored and delivered later.</string>
<string name="not_online_inventory">User not online - inventory has been saved.</string>
<string name="ReceivedGift">You've received a gift! [USER] has given you "[PRODUCT]", and says "[MESSAGE]". You can find your gift in your Received Items folder.</string>
<string name="ReceivedPurchase">Your purchase of [PRODUCT] has been delivered to your Received Items folder.</string>
<!-- voice calls -->
<string name="ringing-im">