Lines 95-101
sub new {
Link Here
|
95 |
{ |
95 |
{ |
96 |
name => 'Intranet prog UI', |
96 |
name => 'Intranet prog UI', |
97 |
dir => $context->config('intrahtdocs') . '/prog', |
97 |
dir => $context->config('intrahtdocs') . '/prog', |
98 |
suffix => '-i-staff-t-prog-v-3006000.po', |
98 |
suffix => '-staff-prog.po', |
99 |
}, |
99 |
}, |
100 |
{ |
100 |
{ |
101 |
name => 'Intranet prog help', |
101 |
name => 'Intranet prog help', |
Lines 114-119
sub new {
Link Here
|
114 |
}; |
114 |
}; |
115 |
} |
115 |
} |
116 |
|
116 |
|
|
|
117 |
# MARC flavours (hardcoded list) |
118 |
for ( "MARC21", "UNIMARC", "NORMARC" ) { |
119 |
# search for strings on staff & opac marc files |
120 |
my $dirs = $context->config('intrahtdocs') . '/prog'; |
121 |
opendir $fh, $context->config('opachtdocs'); |
122 |
for ( grep { not /^\.|\.\.|lib$/ } readdir($fh) ) { |
123 |
$dirs .= ' ' . "$opachtdocs/$_"; |
124 |
} |
125 |
push @{$self->{interface}}, { |
126 |
name => "$_", |
127 |
dir => $dirs, |
128 |
suffix => "-marc-$_.po", |
129 |
}; |
130 |
} |
131 |
|
117 |
bless $self, $class; |
132 |
bless $self, $class; |
118 |
} |
133 |
} |
119 |
|
134 |
|
Lines 333-361
sub install_tmpl {
Link Here
|
333 |
my ($self, $files) = @_; |
348 |
my ($self, $files) = @_; |
334 |
say "Install templates" if $self->{verbose}; |
349 |
say "Install templates" if $self->{verbose}; |
335 |
for my $trans ( @{$self->{interface}} ) { |
350 |
for my $trans ( @{$self->{interface}} ) { |
336 |
print |
351 |
my @t_dirs = split(" ", $trans->{dir}); |
337 |
" Install templates '$trans->{name}'\n", |
352 |
for my $t_dir ( @t_dirs ) { |
338 |
" From: $trans->{dir}/en/\n", |
353 |
my @files = @$files; |
339 |
" To : $trans->{dir}/$self->{lang}\n", |
354 |
my @nomarc = (); |
340 |
" With: $self->{path_po}/$self->{lang}$trans->{suffix}\n" |
355 |
print |
|
|
356 |
" Install templates '$trans->{name}'\n", |
357 |
" From: $t_dir/en/\n", |
358 |
" To : $t_dir/$self->{lang}\n", |
359 |
" With: $self->{path_po}/$self->{lang}$trans->{suffix}\n" |
341 |
if $self->{verbose}; |
360 |
if $self->{verbose}; |
342 |
|
361 |
|
343 |
my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":"$trans->{dir}/en/"; |
362 |
my $trans_dir = ( $trans->{name} =~ /help/ )?"$t_dir":"$t_dir/en/"; |
344 |
my $lang_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":"$trans->{dir}/$self->{lang}"; |
363 |
my $lang_dir = ( $trans->{name} =~ /help/ )?"$t_dir":"$t_dir/$self->{lang}"; |
345 |
$lang_dir =~ s|/en/|/$self->{lang}/|; |
364 |
$lang_dir =~ s|/en/|/$self->{lang}/|; |
346 |
mkdir $lang_dir unless -d $lang_dir; |
365 |
mkdir $lang_dir unless -d $lang_dir; |
347 |
my $excludes = ( $trans->{name} =~ /UI/ )?"-x 'help'":""; |
366 |
my $excludes = ( $trans->{name} !~ /help/ )?"":"-x 'help'"; |
348 |
|
367 |
# if installing MARC po file, only touch corresponding files |
349 |
system |
368 |
my $marc = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":""; # for MARC translations |
350 |
"$self->{process} install " . |
369 |
# if not installing MARC po file, ignore all MARC files |
351 |
"-i $trans_dir " . |
370 |
@nomarc = ( 'marc21', 'unimarc', 'normarc' ) if ( $trans->{name} !~ /MARC/ ); # hardcoded MARC variants |
352 |
"-o $lang_dir ". |
371 |
|
353 |
"-s $self->{path_po}/$self->{lang}$trans->{suffix} -r $excludes" . |
372 |
system |
354 |
( |
373 |
"$self->{process} install " . |
355 |
@$files |
374 |
"-i $trans_dir " . |
356 |
? ' -f ' . join ' -f ', @$files |
375 |
"-o $lang_dir ". |
357 |
: '' |
376 |
"-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " . |
358 |
) |
377 |
"$excludes " . |
|
|
378 |
"$marc " . |
379 |
( @files ? ' -f ' . join ' -f ', @files : '') . |
380 |
( @nomarc ? ' -n ' . join ' -n ', @nomarc : ''); |
381 |
} |
359 |
} |
382 |
} |
360 |
} |
383 |
} |
361 |
|
384 |
|
Lines 365-389
sub update_tmpl {
Link Here
|
365 |
|
388 |
|
366 |
say "Update templates" if $self->{verbose}; |
389 |
say "Update templates" if $self->{verbose}; |
367 |
for my $trans ( @{$self->{interface}} ) { |
390 |
for my $trans ( @{$self->{interface}} ) { |
|
|
391 |
my @files = @$files; |
392 |
my @nomarc = (); |
368 |
print |
393 |
print |
369 |
" Update templates '$trans->{name}'\n", |
394 |
" Update templates '$trans->{name}'\n", |
370 |
" From: $trans->{dir}/en/\n", |
395 |
" From: $trans->{dir}/en/\n", |
371 |
" To : $self->{path_po}/$self->{lang}$trans->{suffix}\n" |
396 |
" To : $self->{path_po}/$self->{lang}$trans->{suffix}\n" |
372 |
if $self->{verbose}; |
397 |
if $self->{verbose}; |
373 |
my $lang_dir = "$trans->{dir}/$self->{lang}"; |
|
|
374 |
|
398 |
|
375 |
my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":"$trans->{dir}/en/"; |
399 |
my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":join("/en/ -i ",split(" ",$trans->{dir}))."/en/"; # multiple source dirs |
376 |
my $excludes = ( $trans->{name} =~ /UI/ )?"-x 'help'":""; |
400 |
# do no process 'help' dirs unless needed |
|
|
401 |
my $excludes = ( $trans->{name} !~ /help/ )?"-x help":""; |
402 |
# if processing MARC po file, only use corresponding files |
403 |
my $marc = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":""; # for MARC translations |
404 |
# if not processing MARC po file, ignore all MARC files |
405 |
@nomarc = ( 'marc21', 'unimarc', 'normarc' ) if ( $trans->{name} !~ /MARC/ ); # hardcoded MARC variants |
377 |
|
406 |
|
378 |
system |
407 |
system |
379 |
"$self->{process} update " . |
408 |
"$self->{process} update " . |
380 |
"-i $trans_dir " . |
409 |
"-i $trans_dir " . |
381 |
"-s $self->{path_po}/$self->{lang}$trans->{suffix} -r $excludes" . |
410 |
"-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " . |
382 |
( |
411 |
"$excludes " . |
383 |
@$files |
412 |
"$marc " . |
384 |
? ' -f ' . join ' -f ', @$files |
413 |
( @files ? ' -f ' . join ' -f ', @files : '') . |
385 |
: '' |
414 |
( @nomarc ? ' -n ' . join ' -n ', @nomarc : ''); |
386 |
) |
|
|
387 |
} |
415 |
} |
388 |
} |
416 |
} |
389 |
|
417 |
|
Lines 405-428
sub create_tmpl {
Link Here
|
405 |
|
433 |
|
406 |
say "Create templates\n" if $self->{verbose}; |
434 |
say "Create templates\n" if $self->{verbose}; |
407 |
for my $trans ( @{$self->{interface}} ) { |
435 |
for my $trans ( @{$self->{interface}} ) { |
|
|
436 |
my @files = @$files; |
437 |
my @nomarc = (); |
408 |
print |
438 |
print |
409 |
" Create templates .po files for '$trans->{name}'\n", |
439 |
" Create templates .po files for '$trans->{name}'\n", |
410 |
" From: $trans->{dir}/en/\n", |
440 |
" From: $trans->{dir}/en/\n", |
411 |
" To : $self->{path_po}/$self->{lang}$trans->{suffix}\n" |
441 |
" To : $self->{path_po}/$self->{lang}$trans->{suffix}\n" |
412 |
if $self->{verbose}; |
442 |
if $self->{verbose}; |
413 |
|
443 |
|
414 |
my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":"$trans->{dir}/en/"; |
444 |
my $trans_dir = ( $trans->{name} =~ /help/ )?"$trans->{dir}":join("/en/ -i ",split(" ",$trans->{dir}))."/en/"; # multiple source dirs |
415 |
my $excludes = ( $trans->{name} =~ /UI/ )?"-x 'help'":""; |
445 |
my $excludes = ( $trans->{name} !~ /help/ )?"-x help":""; |
|
|
446 |
# if processing MARC po file, only use corresponding files |
447 |
my $marc = ( $trans->{name} =~ /MARC/ )?"-m \"$trans->{name}\"":""; # for MARC translations |
448 |
# if not processing MARC po file, ignore all MARC files |
449 |
@nomarc = ( 'marc21', 'unimarc', 'normarc' ) if ( $trans->{name} !~ /MARC/ ); # hardcoded MARC variants |
416 |
|
450 |
|
417 |
system |
451 |
system |
418 |
"$self->{process} create " . |
452 |
"$self->{process} create " . |
419 |
"-i $trans_dir " . |
453 |
"-i $trans_dir " . |
420 |
"-s $self->{path_po}/$self->{lang}$trans->{suffix} -r $excludes" . |
454 |
"-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " . |
421 |
( |
455 |
"$excludes " . |
422 |
@$files |
456 |
"$marc " . |
423 |
? ' -f ' . join ' -f ', @$files |
457 |
( @files ? ' -f ' . join ' -f ', @files : '') . |
424 |
: '' |
458 |
( @nomarc ? ' -n ' . join ' -n ', @nomarc : ''); |
425 |
) |
|
|
426 |
} |
459 |
} |
427 |
} |
460 |
} |
428 |
|
461 |
|
Lines 584-591
appropriate directory.
Link Here
|
584 |
|
617 |
|
585 |
=item translate create F<lang> |
618 |
=item translate create F<lang> |
586 |
|
619 |
|
587 |
Create 3 .po files in F<po> subdirectory: (1) from opac pages templates, (2) |
620 |
Create 4 kinds of .po files in F<po> subdirectory: |
588 |
intranet templates, and (3) from preferences. |
621 |
(1) one from each theme on opac pages templates, |
|
|
622 |
(2) intranet templates and help, |
623 |
(3) preferences, and |
624 |
(4) one for each MARC dialect. |
625 |
|
589 |
|
626 |
|
590 |
=over |
627 |
=over |
591 |
|
628 |
|
Lines 594-600
intranet templates, and (3) from preferences.
Link Here
|
594 |
Contains extracted text from english (en) OPAC templates found in |
631 |
Contains extracted text from english (en) OPAC templates found in |
595 |
<KOHA_ROOT>/koha-tmpl/opac-tmpl/{theme}/en/ directory. |
632 |
<KOHA_ROOT>/koha-tmpl/opac-tmpl/{theme}/en/ directory. |
596 |
|
633 |
|
597 |
=item F<lang>-intranet.po |
634 |
=item F<lang>-staff-prog.po and F<lang>-staff-help.po |
598 |
|
635 |
|
599 |
Contains extracted text from english (en) intranet templates found in |
636 |
Contains extracted text from english (en) intranet templates found in |
600 |
<KOHA_ROOT>/koha-tmpl/intranet-tmpl/prog/en/ directory. |
637 |
<KOHA_ROOT>/koha-tmpl/intranet-tmpl/prog/en/ directory. |
Lines 605-610
Contains extracted text from english (en) preferences. They are found in files
Link Here
|
605 |
located in <KOHA_ROOT>/koha-tmpl/intranet-tmpl/prog/en/admin/preferences |
642 |
located in <KOHA_ROOT>/koha-tmpl/intranet-tmpl/prog/en/admin/preferences |
606 |
directory. |
643 |
directory. |
607 |
|
644 |
|
|
|
645 |
=item F<lang>-marc-{MARC}.po |
646 |
|
647 |
Contains extracted text from english (en) files from opac and intranet, |
648 |
related with MARC dialects. |
649 |
|
608 |
=back |
650 |
=back |
609 |
|
651 |
|
610 |
=item pref-trans update F<lang> |
652 |
=item pref-trans update F<lang> |
611 |
- |
|
|