[GRASS-SVN] r70526 - grass-addons/tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 10 02:48:12 PST 2017
Author: lucadelu
Date: 2017-02-10 02:48:11 -0800 (Fri, 10 Feb 2017)
New Revision: 70526
Added:
grass-addons/tools/transifex_merge.sh
Log:
added script to download po files from transifex and merge in the locale/po directory
Added: grass-addons/tools/transifex_merge.sh
===================================================================
--- grass-addons/tools/transifex_merge.sh (rev 0)
+++ grass-addons/tools/transifex_merge.sh 2017-02-10 10:48:11 UTC (rev 70526)
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Luca Delucchi 2017
+
+# this script has to be launched in `locale` directory.
+# the `locale` directory should contain a folder called `transifex`
+# inside the `transifex` folder you need to run the instruction documentated here
+# https://grasswiki.osgeo.org/wiki/GRASS_messages_translation#Get_the_translated_po_files
+
+MSGMERGE="msgmerge -N --no-wrap"
+
+# download the translation from transifex
+
+cd transifex
+
+tx pull -a
+
+cd ..
+
+cd po
+NEWPODIR="../transifex/.tx/"
+NEWLIBPODIR="${NEWPODIR}grass72.grasslibspot/"
+
+for fil in `ls $NEWLIBPODIR`;
+do
+ MYLANG=`echo $fil | rev | cut -c 13- | rev`
+ sed "s+charset=CHARSET+charset=UTF-8+g" ${NEWLIBPODIR}${MYLANG}_translation > ${NEWLIBPODIR}${MYLANG}_translation_new
+ sed "s+charset=CHARSET+charset=UTF-8+g" ${NEWPODIR}grass72.grassmodspot/${MYLANG}_translation > ${NEWPODIR}grass72.grassmodspot/${MYLANG}_translation_new
+ sed "s+charset=CHARSET+charset=UTF-8+g" ${NEWPODIR}grass72.grasswxpypot/${MYLANG}_translation > ${NEWPODIR}grass72.grasswxpypot/${MYLANG}_translation_new
+ if [ -f grasslibs_${MYLANG}.po ]; then
+ $MSGMERGE ${NEWLIBPODIR}${MYLANG}_translation_new grasslibs_${MYLANG}.po -o grasslibs_${MYLANG}.po2 && mv grasslibs_${MYLANG}.po2 grasslibs_${MYLANG}.po
+ else
+ cp ${NEWLIBPODIR}${MYLANG}_translation_new grasslibs_${MYLANG}.po
+ fi
+ if [ -f grassmods_${MYLANG}.po ]; then
+ $MSGMERGE ${NEWPODIR}grass72.grassmodspot/${MYLANG}_translation_new grassmods_${MYLANG}.po -o grassmods_${MYLANG}.po2 && mv grassmods_${MYLANG}.po2 grassmods_${MYLANG}.po
+ else
+ cp ${NEWPODIR}grass72.grassmodspot/${MYLANG}_translation_new grassmods_${MYLANG}.po
+ fi
+ if [ -f grasswxpy_${MYLANG}.po ]; then
+ $MSGMERGE ${NEWPODIR}grass72.grasswxpypot/${MYLANG}_translation_new grasswxpy_${MYLANG}.po -o grasswxpy_${MYLANG}.po2 && mv grasswxpy_${MYLANG}.po2 grasswxpy_${MYLANG}.po
+ else
+ cp ${NEWPODIR}grass72.grasswxpypot/${MYLANG}_translation_new grasswxpy_${MYLANG}.po
+ fi
+done
+rm -rf ${NEWLIBPODIR} ${NEWPODIR}grass72.grassmodspot/ ${NEWPODIR}grass72.grasswxpypot/
Property changes on: grass-addons/tools/transifex_merge.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/x-sh
Added: svn:eol-style
+ native
More information about the grass-commit
mailing list