diff -uNar ./debian/patches/series /tmp/kk/unity-mod/debian/patches/series --- ./debian/patches/series 2016-03-29 12:28:05.917359952 +0200 +++ /tmp/kk/unity-mod/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -llx-language-selector.patch diff -uNar ./debian/rules /tmp/kk/unity-mod/debian/rules --- ./debian/rules 2016-03-29 12:32:01.825590687 +0200 +++ /tmp/kk/unity-mod/debian/rules 2016-03-29 10:07:04.282757626 +0200 @@ -3,7 +3,7 @@ LDFLAGS+=-Wl,--as-needed %: - dh $@ --with autoreconf --with quilt --fail-missing + dh $@ --with autoreconf --fail-missing override_dh_autoreconf: NOCONFIGURE=1 dh_autoreconf ./autogen.sh diff -uNar ./po/ca@valencia.po /tmp/kk/unity-mod/po/ca@valencia.po --- ./po/ca@valencia.po 2016-03-29 12:23:18.825952780 +0200 +++ /tmp/kk/unity-mod/po/ca@valencia.po 2016-03-29 12:26:52.182546839 +0200 @@ -230,3 +230,19 @@ #~ 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 ./po/es.po /tmp/kk/unity-mod/po/es.po --- ./po/es.po 2016-03-29 12:23:18.825952780 +0200 +++ /tmp/kk/unity-mod/po/es.po 2016-03-29 12:26:52.182546839 +0200 @@ -243,3 +243,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 ./src/menubar.vala /tmp/kk/unity-mod/src/menubar.vala --- ./src/menubar.vala 2016-03-29 12:23:18.845952462 +0200 +++ /tmp/kk/unity-mod/src/menubar.vala 2016-03-29 10:07:04.282757626 +0200 @@ -70,6 +70,8 @@ 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; public MenuBar (Background bg, Gtk.AccelGroup ag) @@ -237,6 +239,73 @@ 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; @@ -288,6 +357,9 @@ { 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); } diff -uNar ./src/unity-greeter.vala /tmp/kk/unity-mod/src/unity-greeter.vala --- ./src/unity-greeter.vala 2016-03-29 12:23:18.893951702 +0200 +++ /tmp/kk/unity-mod/src/unity-greeter.vala 2016-03-29 10:07:04.282757626 +0200 @@ -210,6 +210,16 @@ 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)