From 0ea9dbc2c56febb6d114fd4233e579e3cf1a8c11 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Mon, 7 Mar 2011 18:54:48 +0000 Subject: [PATCH] i18n: * add poedit metadata after generating the pot files. It seems to be useful after all :p git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4399 96395faa-99c1-11dd-bbfe-3dabce05a288 --- generate_pot.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/generate_pot.sh b/generate_pot.sh index 8e58f44e9c..68d82ff1c0 100644 --- a/generate_pot.sh +++ b/generate_pot.sh @@ -81,6 +81,23 @@ echo "Generate $TER_POT" xgettext --keyword=$TER_KEY1 --keyword=$TER_KEY2 --keyword=$TER_KEY3 $GENERAL_OPTION $input_files --output=$TER_POT sed --in-place $TER_POT --expression=s/charset=CHARSET/charset=UTF-8/ +###################################################################### +# Add poedit metadata +# It eases poedit for translators +###################################################################### +# Metadata example +# "X-Poedit-KeywordsList: pxE_dev;pxDt\n" +# "X-Poedit-SourceCharset: utf-8\n" +# "X-Poedit-Basepath: trunk\\\n" +# "X-Poedit-SearchPath-0: pcsx2\n" +# "X-Poedit-SearchPath-1: common\n" +# Normally "...Content-Transfer-Encoding..." is the end of the header. Use it as anchor to place poedit metadata after +COMMON_META="\"X-Poedit-SourceCharset: utf-8\\\n\"\n\"X-Poedit-Basepath: trunk\\\\\\\\\\\n\"\n\"X-Poedit-SearchPath-0: pcsx2\\\n\"\n\"X-Poedit-SearchPath-1: common\\\n\"" +sed --in-place $MAIN_POT --expression=s/'\"Content-Transfer-Encoding: 8bit\\n\"'/"\"Content-Transfer-Encoding: 8bit\\\n\"\n\"X-Poedit-KeywordsList: ${MAIN_KEY1};${MAIN_KEY2}\\\n\"\n${COMMON_META}"/ +sed --in-place $DEV_POT --expression=s/'\"Content-Transfer-Encoding: 8bit\\n\"'/"\"Content-Transfer-Encoding: 8bit\\\n\"\n\"X-Poedit-KeywordsList: ${DEV_KEY1};${DEV_KEY2}\\\n\"\n${COMMON_META}"/ +sed --in-place $ICO_POT --expression=s/'\"Content-Transfer-Encoding: 8bit\\n\"'/"\"Content-Transfer-Encoding: 8bit\\\n\"\n\"X-Poedit-KeywordsList: ${ICO_KEY1}\\\n\"\n${COMMON_META}"/ +sed --in-place $TER_POT --expression=s/'\"Content-Transfer-Encoding: 8bit\\n\"'/"\"Content-Transfer-Encoding: 8bit\\\n\"\n\"X-Poedit-KeywordsList: ${TER_KEY1};${TER_KEY2};${TER_KEY3}\\\n\"\n${COMMON_META}"/ + ###################################################################### # Automatically align the .po to the new pot file ######################################################################