From c098419317a43706ef659aadf05fd57fe3cf37fd Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Wed, 27 Feb 2019 07:29:09 +0100 Subject: [PATCH] Add few documentation to convert DATABASE as there are broken charset in UI --- README.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 03b50c3..f311acf 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,36 @@ Scripting tools to interact with Thea 2 The Shattering's files in order to trans ## Databases To convert from XML -``` -grep Key DATABASE_UI_LOCALIZATION.xml | awk -F'"' '{print "#. "$2"\n" "msgid " "\""$4"\"" "\n" "msgstr " "\"\""}' > DATABASE_UI_LOCALIZATION.pot.tmp -msguniq --no-wrap DATABASE_UI_LOCALIZATION.pot.tmp > DATABASE_UI_LOCALIZATION.pot +```bash +grep Key Database/game_files/DATABASE_UI_LOCALIZATION.xml | grep -v "UI_EMPTY" | 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 ``` ## Modules -To convert from txt : +To convert from txt: -``` +```bash for text in Modules/game_files/*; do ./extract_module.sh "${text}"; done ``` +To convert back from po: + +```bash +for i in Translation/fr/po/Modules/*; do ./rollback_module.sh "${i}" fr; done +``` \ No newline at end of file