aboutsummaryrefslogtreecommitdiffstats
path: root/bin/generate_cobrand_po
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
committerMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
commit987124b09a32248414faf4d0d6615d43b29ac6f6 (patch)
treea549db8af723c981d3b346e855f25d6fd5ff8aa7 /bin/generate_cobrand_po
parentdbf56159e44c1560a413022451bf1a1c4cb22a52 (diff)
parenta085b63ce09f87e83b75cda9b9cd08aadfe75d61 (diff)
Merge tag 'v2.0.4' into fiksgatami-dev
Diffstat (limited to 'bin/generate_cobrand_po')
-rwxr-xr-xbin/generate_cobrand_po14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/generate_cobrand_po b/bin/generate_cobrand_po
index 1770de7c2..8e62230ae 100755
--- a/bin/generate_cobrand_po
+++ b/bin/generate_cobrand_po
@@ -13,14 +13,22 @@ the main FixMyStreet po files
=cut
-my $cobrand = shift;
+use File::Basename qw(dirname);
+use File::Spec;
+my $cobrand = shift;
die "Please provide a cobrand name\n" unless $cobrand;
-my $cobrand_lc = lc( $cobrand );
+my $d = dirname(dirname(File::Spec->rel2abs($0)));
+chdir $d;
-my $PO = "locale/$cobrand.po";
+# Install required code if needed
+system("vendor/bin/carton install --path local-gettext --cpanfile locale/cpanfile --deployment");
+$ENV{PATH} = "local-gettext/bin:$ENV{PATH}";
+$ENV{PERL5LIB} = "local-gettext/lib/perl5:local/lib/perl5";
+my $cobrand_lc = lc( $cobrand );
+my $PO = "locale/$cobrand.po";
my $cobrand_module = "perllib/FixMyStreet/Cobrand/$cobrand.pm";
my $web_templates = "templates/web/$cobrand_lc/";