Hello community,
here is the log from the commit of package yast2-country
checked in at Mon Feb 18 23:58:16 CET 2008.
--------
--- yast2-country/yast2-country.changes 2008-02-07 13:14:09.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-country/yast2-country.changes 2008-02-18 15:35:06.227978000 +0100
@@ -1,0 +2,12 @@
+Mon Feb 18 15:30:45 CET 2008 - jsuchome@suse.cz
+
+- added API for generating Language items (to be used also from
+ inst_complex_welcome client)
+- 2.16.9
+
+--------------------------------------------------------------------
+Fri Feb 15 12:44:54 CET 2008 - visnov@suse.cz
+
+- show icons for languages
+
+------------------------------------------------------------------
Old:
----
yast2-country-2.16.8.tar.bz2
New:
----
yast2-country-2.16.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-country.spec ++++++
--- /var/tmp/diff_new_pack.X21569/_old 2008-02-18 23:58:02.000000000 +0100
+++ /var/tmp/diff_new_pack.X21569/_new 2008-02-18 23:58:02.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-country (Version 2.16.8)
+# spec file for package yast2-country (Version 2.16.9)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -10,13 +10,14 @@
# norootforbuild
+
Name: yast2-country
-Version: 2.16.8
+Version: 2.16.9
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-country-2.16.8.tar.bz2
+Source0: yast2-country-2.16.9.tar.bz2
Prefix: /usr
BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-perl-bindings yast2-testsuite
Requires: yast2-trans-stats yast2-perl-bindings timezone
@@ -24,6 +25,8 @@
Requires: yast2 >= 2.13.70
# Pkg::SetPackageLocale, Pkg::GetTextLocale
Requires: yast2-pkg-bindings >= 2.15.3
+# IconPath support for MultiSelectionBox
+Requires: yast2-core >= 2.16.28
Requires: yast2-country-data
Provides: yast2-config-environment
Provides: yast2-config-keyboard
@@ -65,7 +68,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-country-2.16.8
+%setup -n yast2-country-2.16.9
%build
%{prefix}/bin/y2tool y2autoconf
@@ -132,6 +135,12 @@
/usr/share/YaST2/data/languages/*.ycp
/usr/share/YaST2/modules/Language.y*
%changelog
+* Mon Feb 18 2008 jsuchome@suse.cz
+- added API for generating Language items (to be used also from
+ inst_complex_welcome client)
+- 2.16.9
+* Fri Feb 15 2008 visnov@suse.cz
+- show icons for languages
* Thu Feb 07 2008 jsuchome@suse.cz
- the agent for adapting fvwm2 font not needed anymore (bnc#359183)
- timezone regions sorted according to current locale (bnc#359192)
++++++ yast2-country-2.16.8.tar.bz2 -> yast2-country-2.16.9.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-country-2.16.8/language/src/modules/Language.ycp new/yast2-country-2.16.9/language/src/modules/Language.ycp
--- old/yast2-country-2.16.8/language/src/modules/Language.ycp 2008-02-07 10:56:18.000000000 +0100
+++ new/yast2-country-2.16.9/language/src/modules/Language.ycp 2008-02-18 14:49:53.000000000 +0100
@@ -6,7 +6,7 @@
* Thomas Roelz
* Maintainer: Jiri Suchomel
*
- * $Id: Language.ycp 40336 2007-08-17 13:13:23Z jsuchome $
+ * $Id: Language.ycp 44234 2008-02-07 12:14:21Z jsuchome $
*/
{
@@ -24,6 +24,7 @@
import "Mode";
import "PackageCallbacksInit";
import "PackageSystem";
+import "Popup";
import "ProductFeatures";
import "Stage";
@@ -838,6 +839,22 @@
}
/**
+ * Checks if translation is complete and displays
+ * Continue/Cancel popup messsage if it is not
+ * return true if translation is OK or user agrees with the warning
+ */
+global boolean CheckIncompleteTranslation (string lang) {
+ if (IncompleteTranslation (language))
+ {
+ // continue/cancel message
+ return Popup::ContinueCancel (_("Translation of the primary language is not complete.
+Some texts may be displayed in English.
+"));
+ }
+ return true;
+}
+
+/**
* AutoYaST interface function: Get the Language configuration from a map.
* @param settings imported map
* @return success
@@ -894,6 +911,123 @@
return MakeSimpleProposal ();
}
+// list of items for secondary languages term
+list<term> secondary_items = [];
+
+// kind: `first_screen, `primary, `secondary
+global list<term> GetLanguageItems (symbol kind) {
+
+ list<term> ret = [];
+
+ // already generated in previous run with `primary
+ if (kind == `secondary && secondary_items != [])
+ {
+ return secondary_items;
+ }
+ secondary_items = [];
+
+ boolean use_ascii = GetTextMode ();
+
+ // sort language by ASCII with help of a map
+ // $[ "ascii-name" : [ "user-readable-string", "code" ], ...]
+ // the "user-readable-string" is either ascii or utf8, depending
+ // on textmode probed above (workaround because there isn't any
+ // usable console font for all languages).
+
+ map languageselsort = mapmap (
+ string lang_code, list lang_info, Selection(), {
+ string key = lang_info [1]:lang_code;
+ return $[
+ key : [
+ lang_info[use_ascii ? 1 : 0]:"",
+ lang_code,
+ lang_info[2]:key
+ ]
+ ];
+ }
+ );
+
+ // mapping of language name (translated) to language code
+ map lang2code = $[];
+ // list of language names (translated)
+ list<string> lang_list = [];
+ foreach (any name, list codelist, languageselsort, {
+ lang2code [codelist[2]:""] = codelist[1]:"";
+ lang_list = add (lang_list, codelist[2]:"");
+ });
+
+
+ if (kind == `first_screen)
+ {
+ // FIXME fate 301789
+ ret = maplist (any name, list codelist, languageselsort, {
+ return `item (`id (codelist[1]:""), codelist[0]:"");
+ });
+ }
+ if (Stage::firstboot ())
+ {
+ ret = maplist (string trans_lang, lsort (lang_list), {
+ string code = lang2code [trans_lang]:"";
+ return `item (`id (code), trans_lang, language == code);
+ });
+ }
+ boolean primary_included = false;
+
+ if (kind == `primary || kind == `secondary)
+ {
+ list<string>languages_l = splitstring (languages, ",");
+ // filter the primary language from the list of secondary ones:
+ languages_l = filter (string l, languages_l, ``(l != language));
+
+ boolean icons = !(Stage::initial () || Stage::firstboot ());
+ list<term> primary_items = [];
+ secondary_items = maplist (string trans_lang, lsort (lang_list),
+ {
+ string code = lang2code [trans_lang]:"";
+ primary_items = add (primary_items, icons ?
+ `item (`id (code), `icon(tolower(Language::GetGivenLanguageCountry(code))+"/flag.png"), trans_lang, language == code) :
+ `item (`id (code), trans_lang, language == code));
+ if (language == code)
+ primary_included = true;
+ return icons ?
+ `item (`id (code), `icon(tolower(Language::GetGivenLanguageCountry(code))+"/flag.png"), trans_lang, contains (languages_l, code)) :
+ `item (`id (code), trans_lang, contains (languages_l, code));
+ });
+ if (!primary_included)
+ primary_items = add (primary_items,
+ `item (`id (language), language, true));
+ ret = (kind == `primary) ? primary_items : secondary_items;
+ }
+ return ret;
+}
+
+/**
+ * check if selected language has support on media (F301238)
+ * show a warning when not
+ */
+global void CheckLanguagesSupport (string selected_language) {
+
+ string linguas = (string) SCR::Read (.content.LINGUAS);
+
+ if (linguas == nil) {
+ y2warning ("No LINGUAS tag defined in content file");
+ return;
+ }
+
+ y2milestone ("content LINGUAS %1", linguas);
+ list <string> all_linguas = splitstring (linguas, " ");
+ string language_short = splitstring (selected_language, "_")[0]:"";
+
+ if (!contains (all_linguas, selected_language) &&
+ !contains (all_linguas, language_short))
+ {
+ y2milestone ("Language %1 is not fully supported", selected_language);
+ // popup message
+ Popup::Message (_("Only minimal support for the selected language is included on the media.
+Add the Language Add-On CD as an additional repository to get better support
+for this language."));
+ }
+}
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-country-2.16.8/language/src/select_language.ycp new/yast2-country-2.16.9/language/src/select_language.ycp
--- old/yast2-country-2.16.8/language/src/select_language.ycp 2007-10-22 13:10:54.000000000 +0200
+++ new/yast2-country-2.16.9/language/src/select_language.ycp 2008-02-18 15:00:18.000000000 +0100
@@ -15,7 +15,7 @@
* Summary:
* This client shows main dialog for choosing the language.
*
- * $Id: select_language.ycp 41508 2007-10-22 11:10:54Z jsuchome $
+ * $Id: select_language.ycp 44504 2008-02-15 11:48:15Z visnov $
*
*/
{
@@ -153,25 +153,6 @@
};
/**
- * check if selected language has support on media (F301238)
- * show a warning when not
- */
- define void check_languages_support (string selected_language) {
-
- string linguas = (string) SCR::Read (.content.LINGUAS);
- y2milestone ("content LINGUAS %1", linguas);
- if (linguas == nil) return;
- list<string> ll = splitstring (linguas, " ");
- string l = substring (selected_language, 0, 2);
- if (!contains (ll, selected_language) && !contains (ll, l))
- // popup message
- Popup::Message (_("Only minimal support for the selected language is included on the media.
-Add the Language Add-On CD as an additional repository to get better support
-for this language."));
- }
-
-
- /**
* helper function for updating the "adapt terms" to current language
*/
define void update_adapt_term () {
@@ -211,7 +192,7 @@
if (ProductFeatures::GetBooleanFeature ("globals", "skip_language_dialog"))
{
y2milestone("Skipping language dialog, Language changed to %1",preselected);
- check_languages_support (preselected);
+ Language::CheckLanguagesSupport (preselected);
Language::selection_skipped = true;
return `auto;
}
@@ -235,7 +216,6 @@
// set up selection list with default item
- boolean use_ascii = Language::GetTextMode ();
boolean show_expert = true;
/* ----------------------------------------------------------------------
@@ -261,47 +241,15 @@
more_languages = false;
}
- // sort language by ASCII with help of a map
- // $[ "ascii-name" : [ "user-readable-string", "code" ], ...]
- // the "user-readable-string" is either ascii or utf8, depending
- // on textmode probed above (workaround because there isn't any
- // usable console font for all languages).
-
- map languageselsort = mapmap (
- string lang_code, list lang_info, Language::Selection(), {
- string key = lang_info [1]:lang_code;
- return $[
- key : [
- lang_info[use_ascii ? 1 : 0]:"",
- lang_code,
- lang_info[2]:key
- ]
- ];
- }
- );
-
- // mapping of language name (translated) to language code
- map lang2code = $[];
- // list of language names (translated)
- list<string> lang_list = [];
- foreach (any name, list codelist, languageselsort, {
- lang2code [codelist[2]:""] = codelist[1]:"";
- lang_list = add (lang_list, codelist[2]:"");
- });
-
- term languagesel = `SelectionBox (`id(`language), `opt(`notify), "",
- maplist (any name, list codelist, languageselsort,
- ``(`item(`id(codelist[1]:""), codelist[0]:"",
- (language == codelist[1]:""))))
- );
+ term languagesel = `Empty ();
+ if (Stage::initial ()) // this is actually not reached now...
+ languagesel = `SelectionBox (`id(`language), `opt(`notify), "",
+ Language::GetLanguageItems (`first_screen));
if (Stage::firstboot ())
languagesel = `SelectionBox (`id(`language), `opt(`notify), "",
- maplist (string trans_lang, lsort (lang_list), {
- string code = lang2code [trans_lang]:"";
- return `item (`id (code), trans_lang, language == code);
- })
- );
+ Language::GetLanguageItems (`first_screen));
+
// this type of contents will be shown only for initial installation dialog
term contents = `HVCenter (
@@ -319,39 +267,27 @@
);
}
+ list<term> primary_items = [];
+ list<term> secondary_items = [];
+
// if checkboxes for adapting keyboard and timezone should be shown
boolean adapt_term = more_languages && !Mode::config ();
-
- list<term> primary_items = [];
if (more_languages)
{
- boolean primary_included= false;
-
term languages_term = `MultiSelectionBox (`id(`languages),
// multiselection box label
- _("&Secondary Languages"),
- maplist (string trans_lang, lsort (lang_list), {
- string code = lang2code [trans_lang]:"";
- primary_items = add (primary_items,
- `item (`id (code), trans_lang, language == code));
- if (language == code)
- primary_included = true;
- return
- `item (`id (code), trans_lang, contains (languages, code));
- })
+ _("&Secondary Languages")
);
- if (!primary_included)
- primary_items = add (primary_items,
- `item (`id (language), language, true));
-
- term primary_language_term = `ComboBox (`id(`language), `opt (`notify),
- // combo box label
- _("Primary &Language"), primary_items);
-
+ primary_items = Language::GetLanguageItems (`primary);
+ secondary_items = Language::GetLanguageItems (`secondary);
term primary_term = `HBox (
- `Left (primary_language_term),
- `Right (expert)
+ `Left (
+ `ComboBox (`id(`language), `opt (`notify),
+ // combo box label
+ _("Primary &Language"), primary_items)
+ ),
+ `Right (expert)
);
if (adapt_term)
@@ -462,6 +398,17 @@
Wizard::SetDesktopIcon("yast-language");
+ if (more_languages)
+ {
+ UI::ChangeWidget( `language, `Items, primary_items );
+ UI::ChangeWidget( `languages, `Items, secondary_items );
+ if (!Stage::initial () && !Stage::firstboot ())
+ {
+ UI::ChangeWidget( `language, `IconPath, "/usr/share/locale/l10n/" );
+ UI::ChangeWidget( `languages, `IconPath, "/usr/share/locale/l10n/");
+ }
+ }
+
// No .desktop files in inst-sys - use icon explicitly
if (Stage::initial () || Stage::firstboot ())
Wizard::SetTitleIcon ("yast-language");
@@ -535,20 +482,14 @@
tmz_adapt = (boolean) UI::QueryWidget (`id(`adapt_tmz), `Value);
}
- if (ret == `next && Language::IncompleteTranslation (language))
+ if (ret == `next && !Language::CheckIncompleteTranslation(language))
{
- // continue/cancel message
- if (!Popup::ContinueCancel (_("Translation of the primary language is not complete.
-Some texts may be displayed in English.
-")))
- {
- ret = `not_next;
- continue;
- }
+ ret = `not_next;
+ continue;
}
if (ret == `next && Stage::initial ())
{
- check_languages_support (language);
+ Language::CheckLanguagesSupport (language);
}
if (language != Language::language)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-country-2.16.8/timezone/src/dialogs.ycp new/yast2-country-2.16.9/timezone/src/dialogs.ycp
--- old/yast2-country-2.16.8/timezone/src/dialogs.ycp 2008-02-07 11:03:20.000000000 +0100
+++ new/yast2-country-2.16.9/timezone/src/dialogs.ycp 2008-02-18 15:23:14.000000000 +0100
@@ -11,7 +11,7 @@
* Summary:
* Dialogs for timeone and time configuration.
*
- * $Id: dialogs.ycp 43849 2008-01-23 12:45:45Z jsuchome $
+ * $Id: dialogs.ycp 44234 2008-02-07 12:14:21Z jsuchome $
*/
{
textdomain "country";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-country-2.16.8/timezone/src/Timezone.ycp new/yast2-country-2.16.9/timezone/src/Timezone.ycp
--- old/yast2-country-2.16.8/timezone/src/Timezone.ycp 2008-02-07 13:02:50.000000000 +0100
+++ new/yast2-country-2.16.9/timezone/src/Timezone.ycp 2008-02-07 13:14:22.000000000 +0100
@@ -5,7 +5,7 @@
* Authors: Klaus Kaempf
* Thomas Roelz
*
- * $Id: Timezone.ycp 43224 2007-12-21 15:04:24Z jsuchome $
+ * $Id: Timezone.ycp 44234 2008-02-07 12:14:21Z jsuchome $
*/
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-country-2.16.8/VERSION new/yast2-country-2.16.9/VERSION
--- old/yast2-country-2.16.8/VERSION 2008-02-07 13:13:52.000000000 +0100
+++ new/yast2-country-2.16.9/VERSION 2008-02-18 15:31:29.000000000 +0100
@@ -1 +1 @@
-2.16.8
+2.16.9
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org