Bugzilla – Attachment 3185 Details for
Bug 5777
System preferences Tab content title and Save button partially translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Bug-5777-Update-and-install-syspref-tab-titles.patch (text/plain), 2.26 KB, created by
Frédéric Demians
on 2011-02-19 10:54:25 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2011-02-19 10:54:25 UTC
Size:
2.26 KB
patch
obsolete
>From 7d7f578a71674f029703520ed45c4051aba3cb5c Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Sat, 19 Feb 2011 11:52:25 +0100 >Subject: [PATCH] Bug 5777 Update and install syspref tab titles > >This allow also Save button label translation > >[3.2] It applies >--- > misc/translator/LangInstaller.pm | 13 +++++++++++-- > 1 files changed, 11 insertions(+), 2 deletions(-) > >diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm >index 6b525e7..c38c53e 100644 >--- a/misc/translator/LangInstaller.pm >+++ b/misc/translator/LangInstaller.pm >@@ -131,7 +131,7 @@ sub add_prefs { > } > } > } >- elsif ( $element ) { >+ elsif ( $element && $pref_name ) { > $self->po_append( $self->{file} . "#$pref_name# $element", $comment ); > } > } >@@ -173,7 +173,7 @@ sub update_tab_prefs { > } > } > } >- elsif ( $element ) { >+ elsif ( $element && $pref_name ) { > my $id = $self->{file} . "#$pref_name# $element"; > my $text = $self->get_trans_text( $id ); > $p->[$i] = $text if $text; >@@ -189,6 +189,8 @@ sub get_po_from_prefs { > for my $file ( @{$self->{pref_files}} ) { > my $pref = LoadFile( $self->{path_pref_en} . "/$file" ); > $self->{file} = $file; >+ # Entries for tab titles >+ $self->po_append( $self->{file}, $_ ) for keys %$pref; > while ( my ($tab, $tab_content) = each %$pref ) { > if ( ref($tab_content) eq 'ARRAY' ) { > $self->add_prefs( $tab, $tab_content ); >@@ -254,6 +256,13 @@ sub install_prefs { > for my $file ( @{$self->{pref_files}} ) { > my $pref = LoadFile( $self->{path_pref_en} . "/$file" ); > $self->{file} = $file; >+ # First, keys are replaced (tab titles) >+ $pref = do { >+ my %pref = map { >+ $self->get_trans_text( $self->{file} ) || $_ => $pref->{$_} >+ } keys %$pref; >+ \%pref; >+ }; > while ( my ($tab, $tab_content) = each %$pref ) { > if ( ref($tab_content) eq 'ARRAY' ) { > $self->update_tab_prefs( $pref, $tab_content ); >-- >1.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5777
: 3185