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

(-)a/misc/translator/LangInstaller.pm (-3 / +20 lines)
Lines 29-34 use FindBin qw( $Bin ); Link Here
29
$YAML::Syck::ImplicitTyping = 1;
29
$YAML::Syck::ImplicitTyping = 1;
30
30
31
31
32
# Default file header for .po syspref files
33
my $default_pref_po_header = Locale::PO->new(-msgid => '', -msgstr =>
34
    "Project-Id-Version: PACKAGE VERSION\\n" .
35
    "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\\n" .
36
    "Last-Translator: FULL NAME <EMAIL\@ADDRESS>\\n" .
37
    "Language-Team: Koha Translate List <koha-translate\@lists.koha-community.org>\\n" .
38
    "MIME-Version: 1.0\\n" .
39
    "Content-Type: text/plain; charset=UTF-8\\n" .
40
    "Content-Transfer-Encoding: 8bit\\n" .
41
    "Plural-Forms: nplurals=2; plural=(n > 1);\\n"
42
);
43
44
32
sub set_lang {
45
sub set_lang {
33
    my ($self, $lang) = @_;
46
    my ($self, $lang) = @_;
34
47
Lines 52-58 sub new { Link Here
52
    $self->{verbose}         = $verbose;
65
    $self->{verbose}         = $verbose;
53
    $self->{process}         = "$Bin/tmpl_process3.pl " . ($verbose ? '' : '-q');
66
    $self->{process}         = "$Bin/tmpl_process3.pl " . ($verbose ? '' : '-q');
54
    $self->{path_po}         = "$Bin/po";
67
    $self->{path_po}         = "$Bin/po";
55
    $self->{po}              = {};
68
    $self->{po}              = { '' => $default_pref_po_header };
56
69
57
    # Get all .pref file names
70
    # Get all .pref file names
58
    opendir my $fh, $self->{path_pref_en};
71
    opendir my $fh, $self->{path_pref_en};
Lines 222-229 sub get_po_from_prefs { Link Here
222
235
223
sub save_po {
236
sub save_po {
224
    my $self = shift;
237
    my $self = shift;
238
239
    # Create file header if it doesn't already exist
240
    my $po = $self->{po};
241
    $po->{''} ||= $default_pref_po_header;
242
225
    # Write .po entries into a file put in Koha standard po directory
243
    # Write .po entries into a file put in Koha standard po directory
226
    Locale::PO->save_file_fromhash( $self->po_filename, $self->{po} );
244
    Locale::PO->save_file_fromhash( $self->po_filename, $po );
227
    say "Saved in file: ", $self->po_filename if $self->{verbose};
245
    say "Saved in file: ", $self->po_filename if $self->{verbose};
228
}
246
}
229
247
230
- 

Return to bug 10214