More translateable strings, #1354

This commit is contained in:
Alexey Sokolov
2017-10-30 22:56:36 +00:00
parent cfadadb5d3
commit a80074712a
15 changed files with 365 additions and 331 deletions
+29 -30
View File
@@ -29,14 +29,15 @@ class CSendRaw_Mod : public CModule {
if (pNetwork) {
pNetwork->PutUser(sLine.Token(3, true));
PutModule("Sent [" + sLine.Token(3, true) + "] to " +
pUser->GetUserName() + "/" + pNetwork->GetName());
PutModule(t_f("Sent [{1}] to {2}/{3}")(sLine.Token(3, true),
pUser->GetUserName(),
pNetwork->GetName()));
} else {
PutModule("Network [" + sLine.Token(2) +
"] not found for user [" + sLine.Token(1) + "]");
PutModule(t_f("Network {1} not found for user {2}")(
sLine.Token(2), sLine.Token(1)));
}
} else {
PutModule("User [" + sLine.Token(1) + "] not found");
PutModule(t_f("User {1} not found")(sLine.Token(1)));
}
}
@@ -48,15 +49,15 @@ class CSendRaw_Mod : public CModule {
if (pNetwork) {
pNetwork->PutIRC(sLine.Token(3, true));
PutModule("Sent [" + sLine.Token(3, true) +
"] to IRC Server of " + pUser->GetUserName() + "/" +
pNetwork->GetName());
PutModule(t_f("Sent [{1}] to IRC server of {2}/{3}")(
sLine.Token(3, true), pUser->GetUserName(),
pNetwork->GetName()));
} else {
PutModule("Network [" + sLine.Token(2) +
"] not found for user [" + sLine.Token(1) + "]");
PutModule(t_f("Network {1} not found for user {2}")(
sLine.Token(2), sLine.Token(1)));
}
} else {
PutModule("User [" + sLine.Token(1) + "] not found");
PutModule(t_f("User {1} not found")(sLine.Token(1)));
}
}
@@ -70,14 +71,15 @@ class CSendRaw_Mod : public CModule {
bool OnLoad(const CString& sArgs, CString& sErrorMsg) override {
if (!GetUser()->IsAdmin()) {
sErrorMsg = "You must have admin privileges to load this module";
sErrorMsg =
t_s("You must have admin privileges to load this module");
return false;
}
return true;
}
CString GetWebMenuTitle() override { return "Send Raw"; }
CString GetWebMenuTitle() override { return t_s("Send Raw"); }
bool WebRequiresAdmin() override { return true; }
bool OnWebRequest(CWebSock& WebSock, const CString& sPageName,
@@ -87,14 +89,14 @@ class CSendRaw_Mod : public CModule {
CUser* pUser = CZNC::Get().FindUser(
WebSock.GetParam("network").Token(0, false, "/"));
if (!pUser) {
WebSock.GetSession()->AddError("User not found");
WebSock.GetSession()->AddError(t_s("User not found"));
return true;
}
CIRCNetwork* pNetwork = pUser->FindNetwork(
WebSock.GetParam("network").Token(1, false, "/"));
if (!pNetwork) {
WebSock.GetSession()->AddError("Network not found");
WebSock.GetSession()->AddError(t_s("Network not found"));
return true;
}
@@ -111,7 +113,7 @@ class CSendRaw_Mod : public CModule {
pNetwork->PutUser(sLine);
}
WebSock.GetSession()->AddSuccess("Line sent");
WebSock.GetSession()->AddSuccess(t_s("Line sent"));
}
const map<CString, CUser*>& msUsers = CZNC::Get().GetUserMap();
@@ -135,19 +137,16 @@ class CSendRaw_Mod : public CModule {
MODCONSTRUCTOR(CSendRaw_Mod) {
AddHelpCommand();
AddCommand("Client", static_cast<CModCommand::ModCmdFunc>(
&CSendRaw_Mod::SendClient),
"[user] [network] [data to send]",
"The data will be sent to the user's IRC client(s)");
AddCommand(
"Server",
static_cast<CModCommand::ModCmdFunc>(&CSendRaw_Mod::SendServer),
"[user] [network] [data to send]",
"The data will be sent to the IRC server the user is connected to");
AddCommand(
"Current",
static_cast<CModCommand::ModCmdFunc>(&CSendRaw_Mod::CurrentClient),
"[data to send]", "The data will be sent to your current client");
AddCommand("Client", t_d("[user] [network] [data to send]"),
t_d("The data will be sent to the user's IRC client(s)"),
[=](const CString& sLine) { SendClient(sLine); });
AddCommand("Server", t_d("[user] [network] [data to send]"),
t_d("The data will be sent to the IRC server the user is "
"connected to"),
[=](const CString& sLine) { SendServer(sLine); });
AddCommand("Current", t_d("[data to send]"),
t_d("The data will be sent to your current client"),
[=](const CString& sLine) { CurrentClient(sLine); });
}
};
@@ -157,4 +156,4 @@ void TModInfo<CSendRaw_Mod>(CModInfo& Info) {
}
USERMODULEDEFS(CSendRaw_Mod,
"Lets you send some raw IRC lines as/to someone else")
t_s("Lets you send some raw IRC lines as/to someone else"))