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

(-)a/misc/translator/LangInstaller.pm (-5 / +5 lines)
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
(-)a/misc/translator/po2json (-1 / +1 lines)
Lines 67-73 sub main Link Here
67
67
68
    my $plural_form_count;
68
    my $plural_form_count;
69
    # get po object stack
69
    # get po object stack
70
    my $pos = Locale::PO->load_file_asarray($src) or die "Can't parse po file [$src].";
70
    my $pos = Locale::PO->load_file_asarray($src, 'utf-8') or die "Can't parse po file [$src].";
71
71
72
72
73
    foreach my $po (@$pos)
73
    foreach my $po (@$pos)
(-)a/misc/translator/tmpl_process3.pl (-1 / +1 lines)
Lines 303-309 for my $in_dir ( @in_dirs ) { Link Here
303
}
303
}
304
304
305
# restores the string list from file
305
# restores the string list from file
306
$href = Locale::PO->load_file_ashash($str_file);
306
$href = Locale::PO->load_file_ashash($str_file, 'utf-8');
307
307
308
# guess the charsets. HTML::Templates defaults to iso-8859-1
308
# guess the charsets. HTML::Templates defaults to iso-8859-1
309
if (defined $href) {
309
if (defined $href) {
(-)a/t/LangInstaller.t (-2 / +1 lines)
Lines 50-56 EOF Link Here
50
        . "-o $tempdir/Koha.pot -D $tempdir koha-tmpl/intranet-tmpl/simple.tt";
50
        . "-o $tempdir/Koha.pot -D $tempdir koha-tmpl/intranet-tmpl/simple.tt";
51
51
52
    system($xgettext_cmd);
52
    system($xgettext_cmd);
53
    my $pot = Locale::PO->load_file_asarray("$tempdir/Koha.pot");
53
    my $pot = Locale::PO->load_file_asarray("$tempdir/Koha.pot", 'utf-8');
54
54
55
    my @expected = (
55
    my @expected = (
56
        {
56
        {
57
- 

Return to bug 25501