]> granicus.if.org Git - ejabberd/commitdiff
Fix extraction of language name from PO files
authorBadlop <badlop@process-one.net>
Thu, 20 Oct 2011 13:45:17 +0000 (15:45 +0200)
committerBadlop <badlop@process-one.net>
Thu, 20 Oct 2011 13:45:17 +0000 (15:45 +0200)
contrib/extract_translations/extract_translations.erl
contrib/extract_translations/prepare-translation.sh

index 488357ba630486a6e73a7dccd2c4814079674545..3efaace85e7f172a9b82f40294e243ae59de40e6 100644 (file)
@@ -254,7 +254,7 @@ get_msg_header_props(F, Lines) ->
     end.
 
 prepare_props(MsgProps) ->
-    Language = proplists:get_value("Language:", MsgProps),
+    Language = proplists:get_value("X-Language:", MsgProps),
     Authors = proplists:get_all_values("Author:", MsgProps),
     {Language, Authors}.
 
index 7a40fee78194572e881c74d92ff81db4b956f48c..9f2d54ad69f67686d4e07c293dfc70ace250f4ad 100755 (executable)
@@ -91,7 +91,7 @@ extract_lang_all ()
        cd $MSGS_DIR
        for i in $( ls *.msg ) ; do
                MISSING=`cat $i.translate | grep "\", \"\"}." | wc -l`
-               LANGUAGE=`grep "Language:" $i.translate | sed 's/% Language: //g'`
+               LANGUAGE=`grep "X-Language:" $i.translate | sed 's/% Language: //g'`
                LASTAUTH=`grep "Author:" $i.translate | head -n 1 | sed 's/% Author: //g'`
                echo -e "$i\t$MISSING\t$LANGUAGE\t$LASTAUTH"
        done
@@ -258,7 +258,7 @@ extract_lang_updateall ()
                MISSING=`msgfmt --statistics $PO 2>&1 | awk '{printf "%5s", $4 }'`
                echo -n " $MISSING"
 
-               LANGUAGE=`grep "Language:" $PO | sed 's/\"X-Language: //g' | sed 's/\\\\n\"//g' | awk '{printf "%-12s", $1}'`
+               LANGUAGE=`grep "X-Language:" $PO | sed 's/\"X-Language: //g' | sed 's/\\\\n\"//g' | awk '{printf "%-12s", $1}'`
                echo -n " $LANGUAGE"
 
                LASTAUTH=`grep "Last-Translator" $PO | sed 's/\"Last-Translator: //g' | sed 's/\\\\n\"//g'`