File feature-wizard-auto-lang.patch of Package enlightenment

commit ef1b8cb6f8830cee2cfc4f371e8a0d2d894d48a7
Author: Simon Lees <sflees@suse.de>
Date:   Wed Jun 28 12:58:55 2017 +0930

    auto set language to system lang
    
    If the system language is set this is likely because a user has
    already selected it in a distro's installer and doesn't want to
    set it again so rather then telling a user which language they
    selected as there default just set the language without showing
    the wizard page.

Index: enlightenment-0.24.0/src/modules/wizard/page_010.c
===================================================================
--- enlightenment-0.24.0.orig/src/modules/wizard/page_010.c
+++ enlightenment-0.24.0/src/modules/wizard/page_010.c
@@ -172,17 +172,11 @@ _lang_content_get(E_Intl_Pair *pair, Eva
 static char *
 _lang_text_get(E_Intl_Pair *pair, Evas_Object *obj EINA_UNUSED, const char *part)
 {
-   char buf[4096];
-
    if (!eina_streq(part, "elm.text")) return NULL;
    if (!pair)
      return strdup(_("System Default"));
 
-   if ((!e_intl_language_get()) || (!eina_streq(pair->locale_key, e_intl_language_get())))
-     return strdup(_(pair->locale_translation));
-
-   snprintf(buf, sizeof(buf), "System Default [%s]", pair->locale_translation);
-   return strdup(buf);
+   return strdup(_(pair->locale_translation));
 }
 
 static void
@@ -211,6 +205,24 @@ wizard_page_show(E_Wizard_Page *pg EINA_
       .version = ELM_GENLIST_ITEM_CLASS_VERSION
    };
 
+   /* If we can determine the system language just use it and don't show the page */
+   if (e_intl_language_get())
+      {
+         int i = 0;
+         while (basic_language_predefined_pairs[i].locale_key)
+            {
+                if (eina_streq(basic_language_predefined_pairs[i].locale_key, e_intl_language_get()))
+                   {
+                       lang = basic_language_predefined_pairs[i].locale_key;
+                       eina_stringshare_replace(&e_config->language, lang);
+                       e_intl_language_set(e_config->language);
+                       e_wizard_labels_update();
+                       return 0;
+                   }
+                i++;
+            }
+  }
+
    api->wizard_title_set(_("Language"));
    of = elm_frame_add(e_comp->elm);
    elm_object_text_set(of, _("Select one"));
@@ -267,4 +279,3 @@ wizard_page_apply(E_Wizard_Page *pg EINA
    api->wizard_labels_update();
    return 1;
 }
-
openSUSE Build Service is sponsored by