From 9ce3fc5efa279a3c6a6c84c95bd22899ecdfc2b1 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Tue, 6 Oct 2015 21:57:10 +0900 Subject: [PATCH] Output strings in POT files in the order of file locaiton Keeping the order of strings same as in the original source document helps translators find the sources and they can translate by checking rendered contents :-) Note that Zanata keeps the order of strings in uploaded POT files. Change-Id: I3ecd0516047050b94e8eba902620a4f40dc8fd36 Closes-Bug: #1503266 --- tools/generatepot-rst.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/generatepot-rst.sh b/tools/generatepot-rst.sh index 2a78a5d199..57ea47b4ea 100755 --- a/tools/generatepot-rst.sh +++ b/tools/generatepot-rst.sh @@ -44,7 +44,7 @@ sphinx-build -b gettext $TAG doc/$DOCNAME/source/ doc/$DOCNAME/source/locale/ sed -i -e 's/^"Project-Id-Version: [a-zA-Z0-9\. ]+\\n"$/"Project-Id-Version: \\n"/' \ doc/$DOCNAME/source/locale/common.pot # Create the common pot file -msgcat --sort-output doc/common-rst/source/locale/common-rst.pot \ +msgcat --sort-by-file doc/common-rst/source/locale/common-rst.pot \ doc/$DOCNAME/source/locale/common.pot | \ sed -e 's/^"Project-Id-Version: [a-zA-Z0-9\. ]+\\n"$/"Project-Id-Version: \\n"/' | \ awk '$0 !~ /^\# [a-z0-9]+$/' | awk '$0 !~ /^\# \#-\#-\#-\#-\# /' \ @@ -75,7 +75,7 @@ rm -f doc/common-rst/source/locale/dummy.po # Take care of deleting all temporary files so that git add # doc/$DOCNAME/source/locale will only add the single pot file. # Remove UUIDs, those are not necessary and change too often -msgcat --sort-output doc/$DOCNAME/source/locale/*.pot | \ +msgcat --sort-by-file doc/$DOCNAME/source/locale/*.pot | \ awk '$0 !~ /^\# [a-z0-9]+$/' > doc/$DOCNAME/source/$DOCNAME.pot rm doc/$DOCNAME/source/locale/*.pot rm -rf doc/$DOCNAME/source/locale/.doctrees/