Scripting tools to interact with Thea 2 The Shattering files in order to translate them easily.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
635 B

#!/bin/bash
# to add document to zanata, extract .pot with:
# grep Key DATABASE_UI_LOCALIZATION.xml | awk -F'"' '{print "#. "$2"\n" "msgid " "\""$4"\"" "\n" "msgstr " "\"\""}' > DATABASE_UI_LOCALIZATION.pot
# then pass the .pot in poedit to merge duplication and add the Zanata header
if [[ "$#" -ne 2 ]]; then
echo "Please passe exactly 2 parameters: the .xml and the corresponding .po"
exit 1
fi
LANGUAGE=${2}
WORKDIR="/tmp/thea2/${LANGUAGE}"
PO=${1}
TXT="${PO%%.po}.txt"
FINALDIR="$(pwd)/${LANGUAGE}"
mkdir -p ${WORKDIR}
mkdir -p ${FINALDIR}
readarray -t file < ${PO}
for line in "${file[@]}"; do
echo $line
done