summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2011-01-29 06:18:25 +0000
committerNorbert Preining <preining@logic.at>2011-01-29 06:18:25 +0000
commit7d7ca96b28d4e8cdcda09c5ee2e74ac30a79d03a (patch)
tree19e33086a2f755ac4f4b5afdba227abbc0a6d947 /Master/texmf
parentfd1458caec4330ceb5531fb493ec8e10f12e4253 (diff)
fixes in various places for GUI language support, including support for
deleting keys in TLConfFile git-svn-id: svn://tug.org/texlive/trunk@21221 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl6
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui.pl23
2 files changed, 21 insertions, 8 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index f3852703e6b..783b7e970c6 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -4731,6 +4731,12 @@ sub write_config_file
# if the value has actually changed
$tlmgr_config_file->value($k, $config{$k});
}
+ # make sure that deleted config entries are carried over
+ for my $k ($tlmgr_config_file->keys) {
+ if (not(defined($config{$k}))) {
+ $tlmgr_config_file->delete_key($k);
+ }
+ }
if ($tlmgr_config_file->is_changed) {
$tlmgr_config_file->save;
}
diff --git a/Master/texmf/scripts/texlive/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui.pl
index 653ce846bcb..29355a6119a 100644
--- a/Master/texmf/scripts/texlive/tlmgrgui.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui.pl
@@ -1329,12 +1329,12 @@ sub do_gui_language_setting {
$sw->transient($mw);
$sw->grab();
- my $var = "System";
+ my $var = __("System default");
$var = $config{"gui-lang"} if (defined($config{"gui-lang"}));
$var = $opts{"gui-lang"} if (defined($opts{"gui-lang"}));
$var = (defined($code_lang{$var}) ? $code_lang{$var} : $var);
my $opt = $sw->BrowseEntry(-label => __("Default language for GUI:"), -variable => \$var);
- $opt->insert(0,__("System default"));
+ $opt->insert(0, __("System default"));
my @ll;
foreach my $p (<$Master/tlpkg/translations/*.po>) {
$p =~ s!^.*translations/!!;
@@ -1350,13 +1350,20 @@ sub do_gui_language_setting {
my $f = $sw->Frame;
my $okbutton = $f->Button(-text => __("Ok"),
-command => sub {
- for my $l (keys %code_lang) {
- if ($code_lang{$l} eq $var) {
- if ($config{'gui-lang'} ne $l) {
- $config{'gui-lang'} = $l;
- write_config_file();
+ if ($var eq __("System default")) {
+ # we have to remove the setting in the config file
+ delete($config{'gui-lang'});
+ write_config_file();
+ } else {
+ for my $l (keys %code_lang) {
+ if ($code_lang{$l} eq $var) {
+ if (!defined($config{'gui-lang'}) ||
+ (defined($config{'gui-lang'}) && ($config{'gui-lang'} ne $l))) {
+ $config{'gui-lang'} = $l;
+ write_config_file();
+ }
+ last;
}
- last;
}
}
$sw->destroy;