diff options
author | Struan Donald <struan@exo.org.uk> | 2012-09-26 10:17:04 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-09-26 10:17:04 +0100 |
commit | 632c4f876d9cb04daefdc6dbe00f7f4ea9ce85d9 (patch) | |
tree | 60d34f906f00be3ae0427c52fa8cf2f3517295ac /perllib/PoChange.pm | |
parent | 9e7edef8733f26a81e12f9544d136b43f3f8e9cd (diff) |
generalise make_emptyhomes_po so we can use it for FMB
make some updates to translations scripts so they work on OS X
Use FMB translation in Cobrand
Diffstat (limited to 'perllib/PoChange.pm')
-rw-r--r-- | perllib/PoChange.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/perllib/PoChange.pm b/perllib/PoChange.pm index deecd3b00..9bf18ae27 100644 --- a/perllib/PoChange.pm +++ b/perllib/PoChange.pm @@ -3,6 +3,19 @@ use strict; package PoChange; +sub translate($$) { + my $file = shift; + my $s = shift; + + if ( $file eq 'FixMyStreet-EmptyHomes' ) { + return fixmystreet_to_reportemptyhomes( $s ); + } elsif ( $file eq 'FixMyBarangay' ) { + return fixmystreet_to_fixmybarangay( $s ); + } + + return $s; +} + # Takes a msgid from the main FixMyStreet .po file and # converts it to a msgid for the ReportEmptyHomes .po file sub fixmystreet_to_reportemptyhomes($) { @@ -35,4 +48,14 @@ sub fixmystreet_to_reportemptyhomes($) { return $s; } +sub fixmystreet_to_fixmybarangay($) { + my $s = shift; + + $s =~ s/FixMyStreet/FixMyBarangay/g; + $s =~ s/\bcouncil\b/barangay/g; + $s =~ s/\bCouncil\b/Barangay/g; + + return $s; +} + 1; |