2 # script to update all translations
5 use lib '/home/jmf/kohaclone';
7 # Go through the theme/module combinations we need to update.
11 while (defined($po = readdir(DIR))) {
12 next if $po =~ /(^\.\.?$|img|fam)/;
13 $po =~ /^(.*)-i-(staff|opac).*/;
14 print "lang: $1 interface:$2\n";
15 my ($lang,$interface) = ($1,$2);
16 $interface =~ s/staff/intranet/;
17 system("mkdir ../../koha-tmpl/$interface-tmpl/prog/$lang");
18 system("./tmpl_process3.pl install -i ../../koha-tmpl/$interface-tmpl/prog/en/ -o ../../koha-tmpl/$interface-tmpl/prog/$lang/ -s po/$po -r");
23 my($theme, $module) = @$spec;
25 die "fork: $!\n" unless defined $pid;
28 # If current directory is translator/po instead of translator,
29 # then go back to the parent
30 if ($chdir_needed_p) {
31 chdir('..') || die "..: cd: $!\n";
34 # Now call tmpl_process3.pl to do the real work
36 # Traditionally, the pot file should be named PACKAGE.pot
37 # (for Koha probably something like koha_intranet_css.pot),
38 # but this is not Koha's convention.
40 my $target = "po/${theme}_${module}" . ($pot_p? ".pot": "_$lang.po");
41 rename($target, "$target~") if $pot_p;
42 exec('./tmpl_process3.pl', ($pot_p? 'create': 'update'),
43 '-i', "../../koha-tmpl/$module-tmpl/$theme/en/",
46 die "tmpl_process3.pl: exec: $!\n";