View | Details | Raw Unified | Return to bug 21481
Collapse All | Expand All

(-)a/misc/translator/LangInstaller.pm (-19 / +6 lines)
Lines 101-111 sub new { Link Here
101
            dir    => $context->config('intrahtdocs') . '/prog',
101
            dir    => $context->config('intrahtdocs') . '/prog',
102
            suffix => '-staff-prog.po',
102
            suffix => '-staff-prog.po',
103
        },
103
        },
104
        {
105
            name   => 'Intranet prog help',
106
            dir    => $context->config('intrahtdocs') . '/prog/en/modules/help',
107
            suffix => '-staff-help.po',
108
        },
109
    ];
104
    ];
110
105
111
    # OPAC themes
106
    # OPAC themes
Lines 368-378 sub install_tmpl { Link Here
368
                "    With: $self->{path_po}/$self->{lang}$trans->{suffix}\n"
363
                "    With: $self->{path_po}/$self->{lang}$trans->{suffix}\n"
369
                if $self->{verbose};
364
                if $self->{verbose};
370
365
371
            my $trans_dir = ( $trans->{name} =~ /help/ )?"$t_dir":"$t_dir/en/";
366
            my $trans_dir = "$t_dir/en/";
372
            my $lang_dir  = ( $trans->{name} =~ /help/ )?"$t_dir":"$t_dir/$self->{lang}";
367
            my $lang_dir  = "$t_dir/$self->{lang}";
373
            $lang_dir =~ s|/en/|/$self->{lang}/|;
368
            $lang_dir =~ s|/en/|/$self->{lang}/|;
374
            mkdir $lang_dir unless -d $lang_dir;
369
            mkdir $lang_dir unless -d $lang_dir;
375
            my $excludes = ( $trans->{name} !~ /help/   )?"":"-x 'help'";
376
            # if installing MARC po file, only touch corresponding files
370
            # if installing MARC po file, only touch corresponding files
377
            my $marc     = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":"";            # for MARC translations
371
            my $marc     = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":"";            # for MARC translations
378
            # if not installing MARC po file, ignore all MARC files
372
            # if not installing MARC po file, ignore all MARC files
Lines 383-389 sub install_tmpl { Link Here
383
                "-i $trans_dir " .
377
                "-i $trans_dir " .
384
                "-o $lang_dir  ".
378
                "-o $lang_dir  ".
385
                "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " .
379
                "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " .
386
                "$excludes " .
387
                "$marc " .
380
                "$marc " .
388
                ( @files   ? ' -f ' . join ' -f ', @files : '') .
381
                ( @files   ? ' -f ' . join ' -f ', @files : '') .
389
                ( @nomarc  ? ' -n ' . join ' -n ', @nomarc : '');
382
                ( @nomarc  ? ' -n ' . join ' -n ', @nomarc : '');
Lines 405-413 sub update_tmpl { Link Here
405
            "    To  : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
398
            "    To  : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
406
                if $self->{verbose};
399
                if $self->{verbose};
407
400
408
        my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":join("/en/ -i ",split(" ",$trans->{dir}))."/en/"; # multiple source dirs
401
        my $trans_dir = join("/en/ -i ",split(" ",$trans->{dir}))."/en/"; # multiple source dirs
409
        # do no process 'help' dirs unless needed
410
        my $excludes  = ( $trans->{name} !~ /help/ )?"-x help":"";
411
        # if processing MARC po file, only use corresponding files
402
        # if processing MARC po file, only use corresponding files
412
        my $marc      = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":"";            # for MARC translations
403
        my $marc      = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":"";            # for MARC translations
413
        # if not processing MARC po file, ignore all MARC files
404
        # if not processing MARC po file, ignore all MARC files
Lines 417-423 sub update_tmpl { Link Here
417
            "$self->{process} update " .
408
            "$self->{process} update " .
418
            "-i $trans_dir " .
409
            "-i $trans_dir " .
419
            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " .
410
            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " .
420
            "$excludes " .
421
            "$marc "     .
411
            "$marc "     .
422
            ( @files   ? ' -f ' . join ' -f ', @files : '') .
412
            ( @files   ? ' -f ' . join ' -f ', @files : '') .
423
            ( @nomarc  ? ' -n ' . join ' -n ', @nomarc : '');
413
            ( @nomarc  ? ' -n ' . join ' -n ', @nomarc : '');
Lines 450-457 sub create_tmpl { Link Here
450
            "    To  : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
440
            "    To  : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
451
                if $self->{verbose};
441
                if $self->{verbose};
452
442
453
        my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":join("/en/ -i ",split(" ",$trans->{dir}))."/en/"; # multiple source dirs
443
        my $trans_dir = join("/en/ -i ",split(" ",$trans->{dir}))."/en/"; # multiple source dirs
454
        my $excludes  = ( $trans->{name} !~ /help/ )?"-x help":"";
455
        # if processing MARC po file, only use corresponding files
444
        # if processing MARC po file, only use corresponding files
456
        my $marc      = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":"";            # for MARC translations
445
        my $marc      = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":"";            # for MARC translations
457
        # if not processing MARC po file, ignore all MARC files
446
        # if not processing MARC po file, ignore all MARC files
Lines 461-467 sub create_tmpl { Link Here
461
            "$self->{process} create " .
450
            "$self->{process} create " .
462
            "-i $trans_dir " .
451
            "-i $trans_dir " .
463
            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " .
452
            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " .
464
            "$excludes " .
465
            "$marc " .
453
            "$marc " .
466
            ( @files  ? ' -f ' . join ' -f ', @files   : '') .
454
            ( @files  ? ' -f ' . join ' -f ', @files   : '') .
467
            ( @nomarc ? ' -n ' . join ' -n ', @nomarc : '');
455
            ( @nomarc ? ' -n ' . join ' -n ', @nomarc : '');
Lines 628-634 appropriate directory. Link Here
628
616
629
Create 4 kinds of .po files in F<po> subdirectory:
617
Create 4 kinds of .po files in F<po> subdirectory:
630
(1) one from each theme on opac pages templates,
618
(1) one from each theme on opac pages templates,
631
(2) intranet templates and help,
619
(2) intranet templates,
632
(3) preferences, and
620
(3) preferences, and
633
(4) one for each MARC dialect.
621
(4) one for each MARC dialect.
634
622
Lines 640-646 Create 4 kinds of .po files in F<po> subdirectory: Link Here
640
Contains extracted text from english (en) OPAC templates found in
628
Contains extracted text from english (en) OPAC templates found in
641
<KOHA_ROOT>/koha-tmpl/opac-tmpl/{theme}/en/ directory.
629
<KOHA_ROOT>/koha-tmpl/opac-tmpl/{theme}/en/ directory.
642
630
643
=item F<lang>-staff-prog.po and F<lang>-staff-help.po
631
=item F<lang>-staff-prog.po
644
632
645
Contains extracted text from english (en) intranet templates found in
633
Contains extracted text from english (en) intranet templates found in
646
<KOHA_ROOT>/koha-tmpl/intranet-tmpl/prog/en/ directory.
634
<KOHA_ROOT>/koha-tmpl/intranet-tmpl/prog/en/ directory.
647
- 

Return to bug 21481