Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . lightdm-gtk-greeter (2.0.1-2+lliurex) xenial; urgency=medium . * Change language labels Author: M.Angel Juan --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: https://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: Index: fuentes/src/lightdm-gtk-greeter.c =================================================================== --- fuentes.orig/src/lightdm-gtk-greeter.c +++ fuentes/src/lightdm-gtk-greeter.c @@ -184,6 +184,7 @@ static gchar *current_language; static gchar* get_language (void); static void set_language (const gchar *language); void language_selected_cb (GtkMenuItem *menuitem, gpointer user_data); +static const gchar* gchar_valencian = "ValenciĆ "; /* Screensaver values */ static int timeout, interval, prefer_blanking, allow_exposures; @@ -1003,7 +1004,7 @@ set_session (const gchar *session) menu_iter = menu_items; if (menu_iter) - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_iter->data), TRUE); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_iter->data), TRUE); } g_free (current_session); @@ -1027,14 +1028,23 @@ get_language (void) GList *menu_items, *menu_iter; /* if the user manually selected a language, use it */ - if (current_language) - return g_strdup (current_language); + if (current_language){ + if(g_strcmp0(current_language,gchar_valencian)!=0) + return g_strdup (current_language); + else + return g_strdup_printf("%s","ca_ES@valencia"); + } menu_items = gtk_container_get_children (GTK_CONTAINER (language_menu)); for (menu_iter = menu_items; menu_iter != NULL; menu_iter = g_list_next (menu_iter)) { - if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menu_iter->data))) - return g_strdup (g_object_get_data (G_OBJECT (menu_iter->data), LANGUAGE_DATA_CODE)); + if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menu_iter->data))){ + gchar *lang= g_object_get_data (G_OBJECT (menu_iter->data), LANGUAGE_DATA_CODE); + if (g_strcmp0(lang,gchar_valencian)!=0) + return g_strdup (lang); + else + return g_strdup_printf("%s","ca_ES@valencia"); + } } return NULL; @@ -1046,6 +1056,9 @@ set_language (const gchar *language) const gchar *default_language = NULL; GList *menu_items, *menu_iter; + if ( g_strcmp0(language,gchar_valencian)==0) + language = g_strdup_printf("%s","ca_ES@valencia"); + if (!gtk_widget_get_visible (language_menuitem)) { g_free (current_language); @@ -1062,6 +1075,8 @@ set_language (const gchar *language) gchar *s; gboolean matched; s = g_strdup (g_object_get_data (G_OBJECT (menu_iter->data), LANGUAGE_DATA_CODE)); + if ( g_strcmp0(s,gchar_valencian)==0) + s = g_strdup_printf("%s","ca_ES@valencia"); matched = g_strcmp0 (s, language) == 0; g_free (s); if (matched) @@ -1069,7 +1084,11 @@ set_language (const gchar *language) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_iter->data), TRUE); g_free (current_language); current_language = g_strdup (language); - gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),language); + + if ( g_strcmp0(current_language,"ca_ES@valencia")==0) + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),g_strdup_printf("%s",gchar_valencian)); + else + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),current_language); return; } } @@ -1079,7 +1098,10 @@ set_language (const gchar *language) if (lightdm_get_language ()) { default_language = lightdm_language_get_code (lightdm_get_language ()); - gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), default_language); + if ( g_strcmp0(default_language,"ca_ES@valencia")==0) + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), g_strdup_printf("%s",gchar_valencian)); + else + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), default_language); } if (default_language && g_strcmp0 (default_language, language) != 0) set_language (default_language); @@ -1103,6 +1125,9 @@ language_selected_cb (GtkMenuItem *menui if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem))) { gchar *language = g_object_get_data (G_OBJECT (menuitem), LANGUAGE_DATA_CODE); + if (g_strcmp0(language,gchar_valencian) == 0){ + language = g_strdup_printf("%s","ca_ES@valencia"); + } set_language (language); } } @@ -2908,12 +2933,19 @@ main (int argc, char **argv) gchar *modifier = strchr (code, '@'); if (modifier != NULL) { - gchar *label_new = g_strdup_printf ("%s [%s]", label, modifier+1); + gchar *label_new; + if (g_strcmp0(modifier+1,"valencia")!=0){ + label_new = g_strdup_printf ("%s [%s]", label, modifier+1); + }else{ + label_new = g_strdup_printf ("%s", gchar_valencian); + } g_free (label); label = label_new; } radiomenuitem = gtk_radio_menu_item_new_with_label (languages, label); + if (g_strcmp0(code,"ca_ES@valencia")==0) + code = g_strdup_printf ("%s", gchar_valencian); g_object_set_data (G_OBJECT (radiomenuitem), LANGUAGE_DATA_CODE, (gpointer) code); languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radiomenuitem)); g_signal_connect (G_OBJECT (radiomenuitem), "activate", G_CALLBACK (language_selected_cb), NULL);