Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit eb9b8d995d33c5f90d405c31342b08849f601570 1 parent a4940bc
Mark Longair mhl authored
Showing with 11 additions and 2 deletions.
  1. +9 −0 .tx/config
  2. +1 −1  bin/gettext-extract
  3. +1 −1  locale/FixMyStreet.po
9 .tx/config
View
@@ -0,0 +1,9 @@
+[main]
+host = https://www.transifex.com
+type = PO
+
+[fixmystreet.master]
+file_filter = locale/<lang>.UTF-8/LC_MESSAGES/FixMyStreet.po
+source_file = locale/FixMyStreet.po
+source_lang = en
+
2  bin/gettext-extract
View
@@ -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
2  locale/FixMyStreet.po
View
@@ -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 "
Please sign in to comment.
Something went wrong with that request. Please try again.