diff -uNar /tmp/tmp2/unity-greeter-14.04.11/debian/control /srv/svn/trusty/unity-greeter/trunk/fuentes/debian/control --- /tmp/tmp2/unity-greeter-14.04.11/debian/control 2014-04-08 06:36:56.000000000 +0200 +++ /srv/svn/trusty/unity-greeter/trunk/fuentes/debian/control 2015-02-27 10:00:30.779365323 +0100 @@ -17,6 +17,7 @@ libindicator3-dev, libido3-0.1-dev (>= 13.10.0), liblightdm-gobject-1-dev (>= 1.4.0), + liblightdm-gobject-1-dev-mod, libpixman-1-dev, valac (>= 0.20.0), xvfb, diff -uNar /tmp/tmp2/unity-greeter-14.04.11/po/ca@valencia.po /srv/svn/trusty/unity-greeter/trunk/fuentes/po/ca@valencia.po --- /tmp/tmp2/unity-greeter-14.04.11/po/ca@valencia.po 2014-04-08 06:36:56.000000000 +0200 +++ /srv/svn/trusty/unity-greeter/trunk/fuentes/po/ca@valencia.po 2015-02-27 10:00:30.779365323 +0100 @@ -224,3 +224,18 @@ #~ msgid "_Back" #~ msgstr "_Enrere" + +msgid "Language selection" +msgstr "Selecció d'idioma" + +msgid "User defined (Language Support)" +msgstr "Definit per l'usuari (Suport d'idioma)" + +msgid "English" +msgstr "Anglés" + +msgid "Spanish" +msgstr "Espanyol" + +msgid "Valencian" +msgstr "Valencià" diff -uNar /tmp/tmp2/unity-greeter-14.04.11/po/es.po /srv/svn/trusty/unity-greeter/trunk/fuentes/po/es.po --- /tmp/tmp2/unity-greeter-14.04.11/po/es.po 2014-04-08 06:36:56.000000000 +0200 +++ /srv/svn/trusty/unity-greeter/trunk/fuentes/po/es.po 2015-02-27 10:00:30.779365323 +0100 @@ -239,3 +239,19 @@ #~ msgid "Favorite Color (blue):" #~ msgstr "Color favorito (azul):" + +msgid "Language selection" +msgstr "Selección de idioma" + +msgid "User defined (Language Support)" +msgstr "Definido por el usuario (Soporte de idiomas)" + +msgid "Spanish" +msgstr "Español" + +msgid "Valencian" +msgstr "Valenciano" + +msgid "English" +msgstr "Inglés" + diff -uNar /tmp/tmp2/unity-greeter-14.04.11/src/menubar.vala /srv/svn/trusty/unity-greeter/trunk/fuentes/src/menubar.vala --- /tmp/tmp2/unity-greeter-14.04.11/src/menubar.vala 2015-01-26 22:30:31.000000000 +0100 +++ /srv/svn/trusty/unity-greeter/trunk/fuentes/src/menubar.vala 2015-02-27 09:43:40.667395227 +0100 @@ -69,6 +69,10 @@ public bool high_contrast { get; private set; default = false; } public Gtk.Window? keyboard_window { get; private set; default = null; } public Gtk.AccelGroup? accel_group { get; construct; } + + + public string user_language{get; private set; default = "";} + private static const int HEIGHT = 24; @@ -231,13 +235,79 @@ var item = new Gtk.CheckMenuItem.with_label (_("Screen Reader")); item.toggled.connect (screen_reader_toggled_cb); item.add_accelerator ("activate", accel_group, Gdk.Key.s, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); - item.add_accelerator ("activate", accel_group, Gdk.Key.s, Gdk.ModifierType.SUPER_MASK | Gdk.ModifierType.MOD1_MASK, Gtk.AccelFlags.VISIBLE); + item.add_accelerator ("activate", accel_group, Gdk.Key.s, Gdk.ModifierType.SUPER_MASK | Gdk.ModifierType.MOD1_MASK, Gtk.AccelFlags.VISIBLE); item.show (); submenu.append (item); item.set_active (UGSettings.get_boolean (UGSettings.KEY_SCREEN_READER)); return a11y_item; } + + private Gtk.Widget make_language_selector () + { + var selector_item = new Gtk.MenuItem (); + var hbox = new Gtk.HBox (false, 3); + hbox.show (); + selector_item.add (hbox); + var label= new Gtk.Label(_("Language selection")); + label.show(); + hbox.add(label); + selector_item.show (); + + selector_item.submenu = new Gtk.Menu (); + Gtk.RadioMenuItem? default_item = null; + Gtk.RadioMenuItem? last_item = null; + + var selected = new Gtk.RadioMenuItem.with_label (last_item == null ? null : last_item.get_group (), _("User defined (Language Support)")); + selected.show (); + selector_item.submenu.append (selected); + last_item = selected; + + selected = new Gtk.RadioMenuItem.with_label (last_item == null ? null : last_item.get_group (), _("Spanish")); + selected.show (); + selector_item.submenu.append (selected); + last_item = selected; + selected.toggled.connect (spanish_toggled_cb); + + selected = new Gtk.RadioMenuItem.with_label (last_item == null ? null : last_item.get_group (), _("Valencian")); + selected.show (); + selector_item.submenu.append (selected); + last_item = selected; + selected.toggled.connect (valencian_toggled_cb); + + selected = new Gtk.RadioMenuItem.with_label (last_item == null ? null : last_item.get_group (), _("English")); + selected.show (); + selector_item.submenu.append (selected); + last_item = selected; + selected.toggled.connect (english_toggled_cb); + + return selector_item; + } + + private void spanish_toggled_cb(Gtk.CheckMenuItem item) + { + if(!item.active) + return; + user_language="es_ES"; + } + + private void valencian_toggled_cb(Gtk.CheckMenuItem item) + { + if(!item.active) + return; + user_language="ca_ES@valencia"; + } + + private void english_toggled_cb(Gtk.CheckMenuItem item) + { + if(!item.active) + return; + user_language="en"; + } + + + + private Indicator.Object? load_indicator_file (string indicator_name) { string dir = Config.INDICATOR_FILE_DIR; @@ -289,6 +359,8 @@ { if (indicator_name == "ug-accessibility") { + var language_selector=make_language_selector(); + insert (language_selector, (int) get_children ().length () - 1); var a11y_item = make_a11y_indicator (); insert (a11y_item, (int) get_children ().length () - 1); } @@ -307,6 +379,8 @@ foreach (var entry in io.get_entries ()) indicator_added_cb (io, entry); } + + } } @@ -368,6 +442,7 @@ debug ("LANG=%s LANGUAGE=%s", Environment.get_variable ("LANG"), Environment.get_variable ("LANGUAGE")); } + private void keyboard_toggled_cb (Gtk.CheckMenuItem item) { /* FIXME: The below would be sufficient if gnome-session were running diff -uNar /tmp/tmp2/unity-greeter-14.04.11/src/unity-greeter.vala /srv/svn/trusty/unity-greeter/trunk/fuentes/src/unity-greeter.vala --- /tmp/tmp2/unity-greeter-14.04.11/src/unity-greeter.vala 2014-04-08 06:36:56.000000000 +0200 +++ /srv/svn/trusty/unity-greeter/trunk/fuentes/src/unity-greeter.vala 2015-02-27 10:26:03.123319958 +0100 @@ -205,6 +205,15 @@ var result = false; try { + try + { + if (main_window.menubar.user_language!="") + greeter.set_language(main_window.menubar.user_language); + } + catch (Error llx) + { + //nothing to do + } result = LightDM.greeter_start_session_sync (greeter, session); } catch (Error e)