From db53075a4f7822f4b50d199dd0b1732a13720635 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 8 Feb 2014 00:23:42 +0100 Subject: [PATCH] Add translation tool scripts --- .../translation/a1_make_phrase_diff.py | 54 +++++++++++++++++++ .../translation/a2_merge_phrase_diff.py | 54 +++++++++++++++++++ .../translation/b1_make_words_diff.py | 54 +++++++++++++++++++ .../translation/b2_merge_words_diff.py | 54 +++++++++++++++++++ .../translation/c1_make_string_diff.py | 54 +++++++++++++++++++ .../translation/c2_merge_string_diff.py | 54 +++++++++++++++++++ .../translation/d1_make_botnames_diff.py | 54 +++++++++++++++++++ .../translation/d2_merge_botnames_diff.py | 54 +++++++++++++++++++ 8 files changed, 432 insertions(+) create mode 100644 code/nel/tools/build_gamedata/translation/a1_make_phrase_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/a2_merge_phrase_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/b1_make_words_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/b2_merge_words_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/c1_make_string_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/c2_merge_string_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/d1_make_botnames_diff.py create mode 100644 code/nel/tools/build_gamedata/translation/d2_merge_botnames_diff.py diff --git a/code/nel/tools/build_gamedata/translation/a1_make_phrase_diff.py b/code/nel/tools/build_gamedata/translation/a1_make_phrase_diff.py new file mode 100644 index 000000000..ba9293aae --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/a1_make_phrase_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Make phrase diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "make_phrase_diff" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("a1_make_phrase_diff.log"): + os.remove("a1_make_phrase_diff.log") +shutil.copy("log.log", "a1_make_phrase_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "a1_make_phrase_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/a2_merge_phrase_diff.py b/code/nel/tools/build_gamedata/translation/a2_merge_phrase_diff.py new file mode 100644 index 000000000..89be176c3 --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/a2_merge_phrase_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Merge phrase diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "merge_phrase_diff" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("a2_merge_phrase_diff.log"): + os.remove("a2_merge_phrase_diff.log") +shutil.copy("log.log", "a2_merge_phrase_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "a2_merge_phrase_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/b1_make_words_diff.py b/code/nel/tools/build_gamedata/translation/b1_make_words_diff.py new file mode 100644 index 000000000..845a60831 --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/b1_make_words_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Make words diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "make_words_diff" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("b1_make_words_diff.log"): + os.remove("b1_make_words_diff.log") +shutil.copy("log.log", "b1_make_words_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "b1_make_words_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/b2_merge_words_diff.py b/code/nel/tools/build_gamedata/translation/b2_merge_words_diff.py new file mode 100644 index 000000000..b6048bf05 --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/b2_merge_words_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Merge words diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "merge_words_diff" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("b2_merge_words_diff.log"): + os.remove("b2_merge_words_diff.log") +shutil.copy("log.log", "b2_merge_words_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "b2_merge_words_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/c1_make_string_diff.py b/code/nel/tools/build_gamedata/translation/c1_make_string_diff.py new file mode 100644 index 000000000..915909051 --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/c1_make_string_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Make string diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "make_string_diff" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("c1_make_string_diff.log"): + os.remove("c1_make_string_diff.log") +shutil.copy("log.log", "c1_make_string_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "c1_make_string_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/c2_merge_string_diff.py b/code/nel/tools/build_gamedata/translation/c2_merge_string_diff.py new file mode 100644 index 000000000..44f27a6ed --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/c2_merge_string_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Merge string diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "merge_string_diff" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("c2_merge_string_diff.log"): + os.remove("c2_merge_string_diff.log") +shutil.copy("log.log", "c2_merge_string_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "c2_merge_string_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/d1_make_botnames_diff.py b/code/nel/tools/build_gamedata/translation/d1_make_botnames_diff.py new file mode 100644 index 000000000..330e9e670 --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/d1_make_botnames_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Make botnames diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "make_worksheet_diff", "bot_names.txt" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("d1_make_botnames_diff.log"): + os.remove("d1_make_botnames_diff.log") +shutil.copy("log.log", "d1_make_botnames_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "d1_make_botnames_diff.log") + +raw_input("PRESS ANY KEY TO EXIT") diff --git a/code/nel/tools/build_gamedata/translation/d2_merge_botnames_diff.py b/code/nel/tools/build_gamedata/translation/d2_merge_botnames_diff.py new file mode 100644 index 000000000..e2b0dd2ec --- /dev/null +++ b/code/nel/tools/build_gamedata/translation/d2_merge_botnames_diff.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# \author Jan Boon (Kaetemi) +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +from scripts import * +from buildsite import * +from tools import * +os.chdir(TranslationDirectory) +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Merge botnames diff") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +TranslationTools = findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) +try: + subprocess.call([ TranslationTools, "merge_worksheet_diff", "bot_names.txt" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() +if os.path.isfile("d2_merge_botnames_diff.log"): + os.remove("d2_merge_botnames_diff.log") +shutil.copy("log.log", "d2_merge_botnames_diff_" + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + ".log") +shutil.move("log.log", "d2_merge_botnames_diff.log") + +raw_input("PRESS ANY KEY TO EXIT")