diff options
author | matthew <matthew> | 2008-05-15 09:26:56 +0000 |
---|---|---|
committer | matthew <matthew> | 2008-05-15 09:26:56 +0000 |
commit | f4f1efdd55dfced30d61f98c98e0ea27866ab81d (patch) | |
tree | c65f432d9f2eca5edc9083e5fef6d55d1144a49b /bin/gettext-extract | |
parent | 3d5a80a3f28ea8a1eece15fc691b71e831d0e674 (diff) |
Translate emails too; couple of missing strings; smaller photos on EHA to
fit in column.
Diffstat (limited to 'bin/gettext-extract')
-rwxr-xr-x | bin/gettext-extract | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/bin/gettext-extract b/bin/gettext-extract index 70ed66a4f..eb2682701 100755 --- a/bin/gettext-extract +++ b/bin/gettext-extract @@ -7,7 +7,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: gettext-extract,v 1.1 2008-05-06 10:01:23 matthew Exp $ +# $Id: gettext-extract,v 1.2 2008-05-15 09:26:56 matthew Exp $ if [ -e ../../locale ] then @@ -25,6 +25,15 @@ fi fi fi +# Take chunk of text and escape each line in it for putting in catalogue +function plain_gettext_escape() { + IFS="" + while read LINE + do + LINE=${LINE//\"/\\\"} + echo \"$LINE\\n\" + done +} # File to write to, clear it to start with PO=locale/FixMyStreet.po @@ -51,3 +60,21 @@ mv $TEMP $PO # XXX: Email templates - should be in >1 language... # And the XSL page too. +# Extract email templates +echo >> $PO +echo '#. Please leave the first word "Subject:" untranslated' >> $PO +for X in bci/templates/emails/* +do + # TODO: Should check for "*~" type filenames too, and do the *-livesimply case + # with wildcards rather than checking per template + if [ "$X" != "bci/templates/emails/CVS" -a "$X" != "bci/templates/emails/empty property-confirm" ] + then + echo >> $PO + echo "#: $X" >> $PO + echo msgid \"\" >> $PO + cat $X | plain_gettext_escape >> $PO + echo msgstr \"\" >> $PO + fi +done + + |