Scripting tools to interact with Thea 2 The Shattering files in order to translate them easily.
您最多能選擇 25 個主題 主題必須以字母或數字為開頭,可包含連接號 ('-') 且最長為 35 個字。
 
 
victor.hery 71b1fdb7ca Fix quote inside rollback_module, as it breaks scripts inside module and its useless as module are txt and not xml 4 年前
Database Update source files to v479 4 年前
Modules Update source files to v479 4 年前
Translation/fr Update translation for the pre-release 🎉 5 年前
.gitignore remove Translation files from default gitignore as this IS the point of this repo 5 年前
LICENSE Initial commit 5 年前
README.md Typo in the command line to extract Databases from game files 5 年前
extract_module.sh Add some more comments to clarify the code, and solve the bug that break newline when txt has space in its name 5 年前
rollback_database.sh Add more escaping char in the good order to avoid breaking XML quote for Databases 5 年前
rollback_module.sh Fix quote inside rollback_module, as it breaks scripts inside module and its useless as module are txt and not xml 4 年前

README.md

thea2Shattering_i18n_tools

Scripting tools to interact with Thea 2 The Shattering's files in order to translate them easily.

Databases

To convert from XML

grep Key Database/game_files/DATABASE_UI_LOCALIZATION.xml | grep -v "UI_EMPTY" | grep -v '<!--<Entry' | awk -F'"' '{print "#. "$2"\n" "msgid " "\""$4"\"" "\n" "msgstr " "\"\""}' > /tmp/DATABASE_UI_LOCALIZATION.pot.tmp
sed -i 's/\\E/\\\\E/' /tmp/DATABASE_UI_LOCALIZATION.pot.tmp
# Insert header
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
msguniq --no-wrap /tmp/DATABASE_UI_LOCALIZATION.pot.tmp > Database/pot/DATABASE_UI_LOCALIZATION.pot

To rollback from po:

./rollback_database.sh Database/game_files/DATABASE_UI_LOCALIZATION.xml Translation/fr/po/Database/DATABASE_UI_LOCALIZATION.po fr
./rollback_database.sh Database/game_files/DATABASE_DES_LOCALIZATION.xml Translation/fr/po/Database/DATABASE_DES_LOCALIZATION.po fr

Modules

To convert from txt:

for text in Modules/game_files/*; do ./extract_module.sh "${text}"; done

To convert back from po:

echo "start at $(date)"; time for i in Translation/fr/po/Modules/*; do echo "rollback ${i}..."; time ./rollback_module.sh "${i}" fr; echo "done"; done; echo "end at $(date)";