Spanish (VE), French, Dutch, Russian and Ukranian updates
[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 '../..';
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
12 while (defined($po = readdir(DIR))) {                                                                                                                                                                               
13         next if $po =~ /^\.\.?$/;                                                                                                                                                                                       
14         print "processing $po...\n";                                                                                                                                                                                    
15         my $interface = 'intranet';                                                                                                                                                                                     
16         if ($po =~ /opac/) {                                                                                                                                                                                            
17                     $interface = 'opac';                                                                                                                                                                                        
18                 }                                                                                                                                                                                                               
19         system("./tmpl_process3.pl update -i ../../koha-tmpl/$interface-tmpl/prog/en/ -s po/$po -r");                                                                                                                   
20         print "Finished\n";                                                                                                                                                                                             
21     }              
22
23 closedir DIR;
24
25 =head
26 my($theme, $module) = @$spec;
27    my $pid = fork;
28    die "fork: $!\n" unless defined $pid;
29    if (!$pid) {
30
31       # If current directory is translator/po instead of translator,
32       # then go back to the parent
33       if ($chdir_needed_p) {
34          chdir('..') || die "..: cd: $!\n";
35       }
36
37       # Now call tmpl_process3.pl to do the real work
38       #
39       # Traditionally, the pot file should be named PACKAGE.pot
40       # (for Koha probably something like koha_intranet_css.pot),
41       # but this is not Koha's convention.
42       #
43       my $target = "po/${theme}_${module}" . ($pot_p? ".pot": "_$lang.po");
44       rename($target, "$target~") if $pot_p;
45       exec('./tmpl_process3.pl', ($pot_p? 'create': 'update'),
46             '-i', "../../koha-tmpl/$module-tmpl/$theme/en/",
47             '-s', $target, '-r');
48
49       die "tmpl_process3.pl: exec: $!\n";
50    }
51    wait;
52 }
53 =cut