Lines 310-316
sub save_po {
Link Here
|
310 |
$po->{''} ||= $default_pref_po_header; |
310 |
$po->{''} ||= $default_pref_po_header; |
311 |
|
311 |
|
312 |
# Write .po entries into a file put in Koha standard po directory |
312 |
# Write .po entries into a file put in Koha standard po directory |
313 |
Locale::PO->save_file_fromhash( $self->po_filename("-pref.po"), $po ); |
313 |
Locale::PO->save_file_fromhash( $self->po_filename("-pref.po"), $po, 'utf-8' ); |
314 |
say "Saved in file: ", $self->po_filename("-pref.po") if $self->{verbose}; |
314 |
say "Saved in file: ", $self->po_filename("-pref.po") if $self->{verbose}; |
315 |
} |
315 |
} |
316 |
|
316 |
|
Lines 323-329
sub get_po_merged_with_en {
Link Here
|
323 |
my $po_current = $self->{po}; |
323 |
my $po_current = $self->{po}; |
324 |
|
324 |
|
325 |
# Get po from previous generation |
325 |
# Get po from previous generation |
326 |
my $po_previous = Locale::PO->load_file_ashash( $self->po_filename("-pref.po") ); |
326 |
my $po_previous = Locale::PO->load_file_ashash( $self->po_filename("-pref.po"), 'utf-8' ); |
327 |
|
327 |
|
328 |
for my $id ( keys %$po_current ) { |
328 |
for my $id ( keys %$po_current ) { |
329 |
my $po = $po_previous->{Locale::PO->quote($id)}; |
329 |
my $po = $po_previous->{Locale::PO->quote($id)}; |
Lines 572-578
sub create_installer {
Link Here
|
572 |
# create output file only if there is something to write |
572 |
# create output file only if there is something to write |
573 |
if ( $po ) { |
573 |
if ( $po ) { |
574 |
my $po_file = $self->po_filename( $target->{suffix} ); |
574 |
my $po_file = $self->po_filename( $target->{suffix} ); |
575 |
Locale::PO->save_file_fromhash( $po_file, $po ); |
575 |
Locale::PO->save_file_fromhash( $po_file, $po, 'utf-8' ); |
576 |
say "Saved in file: ", $po_file if $self->{verbose}; |
576 |
say "Saved in file: ", $po_file if $self->{verbose}; |
577 |
} |
577 |
} |
578 |
} |
578 |
} |
Lines 593-599
sub update_installer {
Link Here
|
593 |
if ( $po ) { |
593 |
if ( $po ) { |
594 |
my ( $fh, $po_temp ) = tempfile(); |
594 |
my ( $fh, $po_temp ) = tempfile(); |
595 |
binmode( $fh, ":encoding(UTF-8)" ); |
595 |
binmode( $fh, ":encoding(UTF-8)" ); |
596 |
Locale::PO->save_file_fromhash( $po_temp, $po ); |
596 |
Locale::PO->save_file_fromhash( $po_temp, $po, 'utf-8' ); |
597 |
my $po_file = $self->po_filename( $target->{suffix} ); |
597 |
my $po_file = $self->po_filename( $target->{suffix} ); |
598 |
eval { |
598 |
eval { |
599 |
my $st = system($self->{msgmerge}." ".($self->{verbose}?'':'-q'). |
599 |
my $st = system($self->{msgmerge}." ".($self->{verbose}?'':'-q'). |
Lines 612-618
sub translate_yaml {
Link Here
|
612 |
my $po_file = $self->po_filename( $target->{suffix} ); |
612 |
my $po_file = $self->po_filename( $target->{suffix} ); |
613 |
return $srcyml unless ( -e $po_file ); |
613 |
return $srcyml unless ( -e $po_file ); |
614 |
|
614 |
|
615 |
my $po_ref = Locale::PO->load_file_ashash( $po_file ); |
615 |
my $po_ref = Locale::PO->load_file_ashash( $po_file, 'utf-8' ); |
616 |
|
616 |
|
617 |
my $dstyml = LoadFile( $srcyml ); |
617 |
my $dstyml = LoadFile( $srcyml ); |
618 |
|
618 |
|