diff options
Diffstat (limited to 'bin/update_po_header.bash')
-rwxr-xr-x | bin/update_po_header.bash | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/update_po_header.bash b/bin/update_po_header.bash new file mode 100755 index 000000000..2f37ad5d3 --- /dev/null +++ b/bin/update_po_header.bash @@ -0,0 +1,33 @@ +#!/bin/bash +# +# fixmystreet/bin/gettext-extract +# Generate English language .po files from the source code and email templates, +# for FixMyStreet. Writes the output to appropriate .po files in locale/. +# +# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ + +cd "$(dirname $(readlink -f $BASH_SOURCE))/.." + +# File to write to, clear it to start with +PO=$1 + +# Fix headers +# no such thing as tempfile on OS X +TEMP=`tempfile 2>/dev/null || mktemp /tmp/gettext-extract.XXXXXX` +NOW=`date +"%Y-%m-%d %H:%M%z"` +# strictly POSIX sed on e.g. OS X doesn't let you used \n in replacements so we do this +nl=$'\n'; +cat $PO | sed " + s/SOME DESCRIPTIVE TITLE/FixMyStreet original .po file, autogenerated by gettext-extract/; + s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2011 UK Citizens Online Democracy/; + s/PACKAGE package/main FixMyStreet code/; + s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Matthew Somerville <matthew@mysociety.org>, 2011-06-03./; + + s/PACKAGE VERSION/1.0\\\n\"\\$nl\"Report-Msgid-Bugs-To: matthew@mysociety.org/; + 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=2; plural=n != 1;/; +" >> $TEMP +mv $TEMP $PO |