summaryrefslogtreecommitdiff
path: root/npc/commands/language.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-02-19 19:01:30 -0300
committerJesusaves <cpntb1@ymail.com>2020-02-19 19:01:30 -0300
commitdf8c51fd591c450d8d4062a7d725eee5718b79ae (patch)
tree3c185afd72f78fd8c03faedf51c3684400f204ff /npc/commands/language.txt
parentcd21408fe9cc185978e53d1cde26ba095b73ae70 (diff)
downloadserverdata-df8c51fd591c450d8d4062a7d725eee5718b79ae.tar.gz
serverdata-df8c51fd591c450d8d4062a7d725eee5718b79ae.tar.bz2
serverdata-df8c51fd591c450d8d4062a7d725eee5718b79ae.tar.xz
serverdata-df8c51fd591c450d8d4062a7d725eee5718b79ae.zip
Add a new command: @translate <npc file>
This will return you a clickable link which will set Transifex in advance, so you can jump straight to translating.
Diffstat (limited to 'npc/commands/language.txt')
-rw-r--r--npc/commands/language.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/npc/commands/language.txt b/npc/commands/language.txt
index a03e2cf70..24cc07feb 100644
--- a/npc/commands/language.txt
+++ b/npc/commands/language.txt
@@ -31,7 +31,30 @@ OnCall:
CMD_lang();
close;
+OnTranslate:
+ // Implode, using a slash at whitespaces
+ .@request$ = implode(.@atcmd_parameters$, "%2F");
+ // No NPC provided?
+ if (.@request$ == "") {
+ dispbottom l("Usage: @translate <npc file>");
+ dispbottom l("Example: @translate Nard");
+ dispbottom l("Example: @translate Elmo");
+ dispbottom l("Example: @translate npc/002-1/arpan");
+ dispbottom l("PS. Doesn't always work. You need an account at %s", "@@https://www.transifex.com/akaras|Transifex@@ and to be at ManaPlus Team.");
+ end;
+ }
+ // Add .txt extension of needed
+ if (!compare(.@request$, ".txt")
+ .@request$ += ".txt"
+ // Fix stuff for URL format
+ .@request$ = replacestr(.@request$, "/", "%2F");
+ .@request$ = strtolower(.@request$);
+ // Give your translation link
+ dispbottom "@@https://www.transifex.com/akaras/saulc-tmw-fork/translate/#"+languagecode()+"/server-data?q=occurrence%3A"+.@request$+"|Translate with Transifex@@";
+ close;
+
OnInit:
bindatcmd "lang", "@lang::OnCall", 0, 60, 0;
+ bindatcmd "translate", "@lang::OnTranslate", 0, 60, 0;
end;
}