Koha/misc/translator/install-code.pl
Frédéric Demians 2da4f30214 Bug 4154 - Follow-up
- Modify install-code.pl to install prefs with templates
- Update .po preferences file in order to get last 'en' preferences

For 3.4, I will do a script which will handle together the 3 .po file:
opac, intranet and preferences (and .tt files if necessary). Don't do it
now, since it will change files naming convention.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-11 18:00:20 -05:00

47 lines
1,007 B
Perl
Executable file

#!/usr/bin/perl
use strict;
=head1 NAME
install-code.pl
=head1 USAGE
Install templates and preferences for given language codes.
For example:
./install-code fr-FR en-ES
creates templates for languages: fr-FR and en-ES
=cut
sub install_code {
my $code = shift;
opendir(PO_DIR, "po") or die "Unable to open po directory";
my @po_files = grep { /^$code-i-opac|^$code-i-staff/ } readdir PO_DIR;
closedir PO_DIR;
foreach ( @po_files ) {
my ($interface) = /(staff|opac)/;
$interface =~ s/staff/intranet/;
mkdir "../../koha-tmpl/$interface-tmpl/prog/$code";
print $_, " : ", $interface, "\n";
my $cmd = "./tmpl_process3.pl install -r " .
"-i ../../koha-tmpl/$interface-tmpl/prog/en/ " .
"-o ../../koha-tmpl/$interface-tmpl/prog/$code " .
"-s po/$_";
system $cmd;
}
system "./pref-trans install $code";
}
# Main
install_code ( $_ ) foreach ( @ARGV );