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

(-)a/misc/translator/LangInstaller.pm (-2 / +24 lines)
Lines 147-153 sub get_trans_text { Link Here
147
    my ($self, $msgid, $default) = @_;
147
    my ($self, $msgid, $default) = @_;
148
148
149
    my $po = $self->{po}->{Locale::PO->quote($msgid)};
149
    my $po = $self->{po}->{Locale::PO->quote($msgid)};
150
    if ($po) {
150
    if ( $po and not defined( $po->fuzzy() ) ) {
151
        my $msgstr = Locale::PO->dequote($po->msgstr);
151
        my $msgstr = Locale::PO->dequote($po->msgstr);
152
        if ($msgstr and length($msgstr) > 0) {
152
        if ($msgstr and length($msgstr) > 0) {
153
            return $msgstr;
153
            return $msgstr;
Lines 174-179 sub get_translated_tab_content { Link Here
174
        } keys %$tab_content
174
        } keys %$tab_content
175
    };
175
    };
176
176
177
    if ( keys %$translated_tab_content != keys %$tab_content ) {
178
        my %duplicates;
179
        for my $section (keys %$tab_content) {
180
            push @{$duplicates{$self->get_trans_text("$file $section", $section)}}, $section;
181
        }
182
        for my $translation (keys %duplicates) {
183
            if (@{$duplicates{$translation}} > 1) {
184
                warn qq(In file "$file", "$translation" is a translation for sections ") . join('", "', @{$duplicates{$translation}}) . '"';
185
            }
186
        }
187
    }
188
177
    return $translated_tab_content;
189
    return $translated_tab_content;
178
}
190
}
179
191
Lines 251-256 sub install_prefs { Link Here
251
            } keys %$pref
263
            } keys %$pref
252
        };
264
        };
253
265
266
        if ( keys %$translated_pref != keys %$pref ) {
267
            my %duplicates;
268
            for my $tab (keys %$pref) {
269
                push @{$duplicates{$self->get_trans_text($file, $tab)}}, $tab;
270
            }
271
            for my $translation (keys %duplicates) {
272
                if (@{$duplicates{$translation}} > 1) {
273
                    warn qq(In file "$file", "$translation" is a translation for tabs ") . join('", "', @{$duplicates{$translation}}) . '"';
274
                }
275
            }
276
        }
254
277
255
        my $file_trans = $self->{po_path_lang} . "/$file";
278
        my $file_trans = $self->{po_path_lang} . "/$file";
256
        print "Write $file\n" if $self->{verbose};
279
        print "Write $file\n" if $self->{verbose};
257
- 

Return to bug 31640