Bug 4432: Fixes XHTML in serials-edit.tmpl.
[koha.git] / misc / translator / update.pl
1 #!/usr/bin/perl
2 # script to update all translations
3 use strict;
4 use warnings;
5 use lib '/home/chris/git/koha.git';
6 use C4::Languages;
7 # Go through the theme/module combinations we need to update.
8 my $dir = "po";
9 my $po;
10 opendir (DIR,$dir);
11 while (defined($po = readdir(DIR))) {
12     next if $po =~ /^\.\.?$/;
13     print "processing $po...\n";
14     my $interface = 'intranet';
15     if ($po =~ /opac/) {
16         $interface = 'opac';
17     }
18     system("./tmpl_process3.pl update -i ../../koha-tmpl/$interface-tmpl/prog/en/ -s po/$po -r");
19     print "Finished\n";
20 }
21 closedir DIR;
22
23 =head
24 my($theme, $module) = @$spec;
25    my $pid = fork;
26    die "fork: $!\n" unless defined $pid;
27    if (!$pid) {
28
29       # If current directory is translator/po instead of translator,
30       # then go back to the parent
31       if ($chdir_needed_p) {
32          chdir('..') || die "..: cd: $!\n";
33       }
34
35       # Now call tmpl_process3.pl to do the real work
36       #
37       # Traditionally, the pot file should be named PACKAGE.pot
38       # (for Koha probably something like koha_intranet_css.pot),
39       # but this is not Koha's convention.
40       #
41       my $target = "po/${theme}_${module}" . ($pot_p? ".pot": "_$lang.po");
42       rename($target, "$target~") if $pot_p;
43       exec('./tmpl_process3.pl', ($pot_p? 'create': 'update'),
44             '-i', "../../koha-tmpl/$module-tmpl/$theme/en/",
45             '-s', $target, '-r');
46
47       die "tmpl_process3.pl: exec: $!\n";
48    }
49    wait;
50 }
51 =cut