Koha/misc/translator/install-code.pl
Frederic Demians e7bf746d6c Two fixes to speed up (a little bit) installation process
Add a explanation on DBD::mysql installation without test suite.
Add /misc/translator/install-code.pl script that creates templates
for specified language codes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:46 -05:00

46 lines
951 B
Perl
Executable file

#!/usr/bin/perl
use strict;
=head1 NAME
install-code.pl
=head1 USAGE
Install templates 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;
}
}
# Main
install_code ( $_ ) foreach ( @ARGV );