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

Index: enlightenment-0.24.99.20201230.e8d6d2c5d/src/modules/wizard/page_010.c
===================================================================
--- enlightenment-0.24.99.20201230.e8d6d2c5d.orig/src/modules/wizard/page_010.c
+++ enlightenment-0.24.99.20201230.e8d6d2c5d/src/modules/wizard/page_010.c
@@ -175,17 +175,12 @@ _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);
 }
 
 static void
@@ -213,6 +208,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);
openSUSE Build Service is sponsored by