home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / clients / country_simple_proposal.ycp < prev    next >
Text File  |  2006-11-29  |  2KB  |  65 lines

  1. /**
  2.  * File:        country_simple_proposal.ycp
  3.  * Author:        Jiri Suchomel <jsuchome@suse.cz>
  4.  * Purpose:        Proposal for both language and keyboard layout settings.
  5.  *
  6.  * $Id: country_simple_proposal.ycp 33046 2006-09-22 08:18:34Z jsuchome $
  7.  */
  8. {
  9.     textdomain "country";
  10.  
  11.     import "HTML";
  12.     import "Keyboard";
  13.     import "Language";
  14.  
  15.     string func  = (string) WFM::Args(0);
  16.     map    param = (map) WFM::Args(1);
  17.     map    ret   = $[];
  18.  
  19.     if ( func == "MakeProposal" )
  20.     {
  21.     boolean force_reset      = param["force_reset"     ]:false;
  22.     boolean language_changed = param["language_changed"]:false;
  23.     // summary label <%1>-<%2> are HTML tags, leave untouched
  24.     string kbd_proposal    = sformat (_("<%1>Keyboard Layout<%2>: %3"),
  25.             "a href=\"country--keyboard\"", "/a",
  26.             Keyboard::MakeProposal (force_reset, language_changed)
  27.     );
  28.     list<string> proposal    =
  29.         Language::MakeProposal (force_reset, language_changed);
  30.     // summary label <%1>-<%2> are HTML tags, leave untouched
  31.     proposal[0]    = sformat (_("<%1>Language<%2>: %3"),
  32.              "a href=\"country--language\"", "/a",
  33.              Language::GetName ()
  34.     );
  35.  
  36.     ret = $[
  37.         "preformatted_proposal" : HTML::List (add (proposal, kbd_proposal)),
  38.         "language_changed"    : false,
  39.         "links"    : [ "country--language", "country--keyboard" ]
  40.     ];
  41.     }
  42.     else if ( func == "Description" )
  43.     {
  44.     ret    = $[
  45.         // rich text label
  46.         "rich_text_title"    :    _("Locale Settings"),
  47.         "menu_titles"        : [
  48.         // menu button label
  49.         $[ "id"    : "country--language", "title" : _("&Language") ],
  50.         // menu button label
  51.         $[ "id"    : "country--keyboard", "title" : _("&Keyboard Layout") ]
  52.         ],
  53.         "id"            : "country",
  54.     ];
  55.     }
  56.     else if (func == "AskUser")
  57.     {
  58.     if (param["chosen_id"]:"" == "country--keyboard")
  59.         ret = (map) WFM::CallFunction ("keyboard_proposal", [func, param]);
  60.     else
  61.         ret = (map) WFM::CallFunction ("language_proposal", [func, param]);
  62.     }
  63.     return ret;
  64. }
  65.