Fix for Bug 4024, Search history template problems, and other fixes.
[koha.git] / misc / translator / install-code.pl
blob2c49da9a4e57bc81ab057cd24414a74a810a84cf
1 #!/usr/bin/perl
3 use strict;
5 =head1 NAME
7 install-code.pl
9 =head1 USAGE
11 Install templates for given language codes.
13 For example:
15 ./install-code fr-FR en-ES
17 creates templates for languages: fr-FR and en-ES
19 =cut
23 sub install_code {
24 my $code = shift;
25 opendir(PO_DIR, "po") or die "Unable to open po directory";
26 my @po_files = grep { /^$code-i-opac|^$code-i-staff/ } readdir PO_DIR;
27 closedir PO_DIR;
29 foreach ( @po_files ) {
30 my ($interface) = /(staff|opac)/;
31 $interface =~ s/staff/intranet/;
32 mkdir "../../koha-tmpl/$interface-tmpl/prog/$code";
33 print $_, " : ", $interface, "\n";
34 my $cmd = "./tmpl_process3.pl install -r " .
35 "-i ../../koha-tmpl/$interface-tmpl/prog/en/ " .
36 "-o ../../koha-tmpl/$interface-tmpl/prog/$code/ " .
37 "-s po/$_";
38 system $cmd;
43 # Main
45 install_code ( $_ ) foreach ( @ARGV );