[yast-commit] r40879 - in /trunk/packager: VERSION agents/ag_xmlrepos package/yast2-packager.changes src/clients/inst_productsources.ycp

Author: locilka Date: Wed Sep 12 16:21:36 2007 New Revision: 40879 URL: http://svn.opensuse.org/viewcvs/yast?rev=40879&view=rev Log: - Fixed evaluation of $short_language localization key in online repositories. - Adapted ag_xmlrepos to understand xml:lang="..." additionally to lang="..." (both #299230). - 2.15.78 Modified: trunk/packager/VERSION trunk/packager/agents/ag_xmlrepos trunk/packager/package/yast2-packager.changes trunk/packager/src/clients/inst_productsources.ycp Modified: trunk/packager/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=40879&r1=408... ============================================================================== --- trunk/packager/VERSION (original) +++ trunk/packager/VERSION Wed Sep 12 16:21:36 2007 @@ -1 +1 @@ -2.15.77 +2.15.78 Modified: trunk/packager/agents/ag_xmlrepos URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/agents/ag_xmlrepos?rev=4... ============================================================================== --- trunk/packager/agents/ag_xmlrepos (original) +++ trunk/packager/agents/ag_xmlrepos Wed Sep 12 16:21:36 2007 @@ -20,7 +20,7 @@ } elsif ($variable =~ /^HASH\(/) { return [$variable]; } else { - warn "Unknown: ".$variable."\n"; + y2error ("Unknown: ".$variable); return []; } } @@ -141,7 +141,16 @@ my $variable_list = GetListFromVariable ($one_repo->{$key} || {}); foreach my $repo_keys (@{$variable_list}) { - my $lang = $repo_keys->{'lang'}->{'value'} || $default_lang; + my $lang = ""; + + if (defined $repo_keys->{'lang'}->{'value'}) { + $lang = $repo_keys->{'lang'}->{'value'}; + } elsif (defined $repo_keys->{'xml:lang'}->{'value'}) { + $lang = $repo_keys->{'xml:lang'}->{'value'}; + } else { + $lang = $default_lang; + } + $this_repo->{'localized_'.$key}->{$lang} = $repo_keys->{'value'} || ""; } Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.c... ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Wed Sep 12 16:21:36 2007 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Wed Sep 12 16:16:08 CEST 2007 - locilka@suse.cz + +- Fixed evaluation of $short_language localization key in online + repositories. +- Adapted ag_xmlrepos to understand xml:lang="..." additionally to + lang="..." (both #299230). +- 2.15.78 + +------------------------------------------------------------------- Tue Sep 11 16:02:49 CEST 2007 - locilka@suse.cz - Online repositories need to be added with unique alias (#309317). Modified: trunk/packager/src/clients/inst_productsources.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_product... ============================================================================== --- trunk/packager/src/clients/inst_productsources.ycp (original) +++ trunk/packager/src/clients/inst_productsources.ycp Wed Sep 12 16:21:36 2007 @@ -490,6 +490,9 @@ } }); + // just for debugging purposes + y2debug ("%1", list_of_repos); + return true; } @@ -609,9 +612,15 @@ language_long = GetCurrentLang (); // fallback if no LANG variable set - if (language_long == nil) + if (language_long == nil || language_long == "") language_long = Language::language; + // de_DE.UTF-8 --> de_DE + integer dot_pos = search (language_long, "."); + if (dot_pos != nil) { + language_long = substring (language_long, 0, dot_pos); + } + if (language_long != nil) { if (size(language_long) >= 2) { language_short = substring (language_long, 0, 2); @@ -679,6 +688,7 @@ string GetLocalizedString (string current_id, list <string> possible_keys) { string ret = ""; + // try localized strings at first foreach (string possible_key, possible_keys, { string loc_key = sformat ("localized_%1", possible_key); @@ -686,20 +696,18 @@ ret = list_of_repos[current_id, loc_key, language_long]:""; break; } else if (list_of_repos[current_id, loc_key, language_short]:"" != "") { - ret = list_of_repos[current_id, loc_key, language_long]:""; + ret = list_of_repos[current_id, loc_key, language_short]:""; break; } }); if (ret != "") return ret; + // try default strings foreach (string possible_key, possible_keys, { if (list_of_repos[current_id, possible_key]:"" != "") { ret = list_of_repos[current_id, possible_key]:""; break; - } else if (list_of_repos[current_id, possible_key]:"" != "") { - ret = list_of_repos[current_id, possible_key]:""; - break; } }); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org