Salome HOME
#12754 fixed i18n accent francais
[tools/sat.git] / src / i18n / build_strings.sh
index 9e2a95ff3eefab852c34482e8b2aeb62b0b288f6..61a544c5d94d93ded2fb7d64e23aa5cf3781f1e0 100755 (executable)
@@ -1,20 +1,40 @@
 #!/bin/bash
 
-# This script gets the strings to internationalise from the source code
+# This script gets the strings from code to internationalize from the source code
 
 I18HOME=`dirname $0`
 SRC_DIR=$I18HOME/../..
 
 # get strings for french translation
-echo Build strings for French
+echo "Build strings for French, create and merging salomeTools.po" 
 
 poFile=$I18HOME/fr/LC_MESSAGES/salomeTools.po
 refFile=$I18HOME/fr/LC_MESSAGES/ref.pot
 
-xgettext $SRC_DIR/*.py $SRC_DIR/common/*.py \
-    --no-wrap --no-location --language=Python --omit-header \
-    --output=$refFile
-msgmerge -q --update $poFile $refFile
-msgattrib --no-obsolete -o $poFile $poFile
+cp ${poFile} ${poFile}_old
+
+xgettext $SRC_DIR/src/i18n/*.py \
+         $SRC_DIR/*.py \
+         $SRC_DIR/commands/*.py \
+         $SRC_DIR/src/*.py \
+         --no-wrap \
+         --no-location \
+         --language=Python \
+         --omit-header \
+         --output=${refFile}
+
+msgmerge --quiet --update --previous $poFile $refFile
+
+#retirer les messages obsolètes « #~ »
+#msgattrib --no-obsolete -o $poFile $poFile
+
+#ne pas retirer les messages obsolètes « #~ »
+msgattrib --previous --output-file ${poFile} ${poFile}
+
 rm $refFile
 
+echo "Do translate stuff please..."
+meld ${poFile} ${poFile}_old
+
+echo "Do not forget 'translate.py' or 'translate.sh' to create salomeTools.mo"
+