From eb9b8d995d33c5f90d405c31342b08849f601570 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Fri, 19 Oct 2012 13:52:13 +0100 Subject: Set up internationalization with Transifex gettext-extract needs to be changed to instantiate values in the Plural-Forms header line, otherwise on pushing the source pot file (locale/FixMyStreet.po) it fails one of the checks that Transifex runs (msgfmt -c). This commit also adds the .tx/config configuration file, which points to the right project on Transifix and specifies where the source and translated files are in the project structure. --- .tx/config | 9 +++++++++ bin/gettext-extract | 2 +- locale/FixMyStreet.po | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .tx/config diff --git a/.tx/config b/.tx/config new file mode 100644 index 000000000..44db89d9e --- /dev/null +++ b/.tx/config @@ -0,0 +1,9 @@ +[main] +host = https://www.transifex.com +type = PO + +[fixmystreet.master] +file_filter = locale/.UTF-8/LC_MESSAGES/FixMyStreet.po +source_file = locale/FixMyStreet.po +source_lang = en + diff --git a/bin/gettext-extract b/bin/gettext-extract index 6bae8aa36..e77cf9cb0 100755 --- a/bin/gettext-extract +++ b/bin/gettext-extract @@ -46,7 +46,7 @@ cat $PO | sed " s/POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE/POT-Creation-Date: $NOW/; s/LL@li.org/team@fixmystreet.com/; s/charset=CHARSET/charset=UTF-8/; - s/8bit/8bit\\\n\"\\$nl\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;/; + s/8bit/8bit\\\n\"\\$nl\"Plural-Forms: nplurals=2; plural=n != 1;/; " >> $TEMP mv $TEMP $PO diff --git a/locale/FixMyStreet.po b/locale/FixMyStreet.po index 38338c113..6d526ac50 100644 --- a/locale/FixMyStreet.po +++ b/locale/FixMyStreet.po @@ -15,7 +15,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" #: perllib/FixMyStreet/DB/Result/Problem.pm:563 perllib/FixMyStreet/DB/ResultSet/Problem.pm:339 msgid " and " -- cgit v1.2.3