|
|
- #!/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
|