Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        Makefile.am e_includes.h e_intl.c e_intl.h e_main.c 
Added Files:
        e_prefix.c e_prefix.h 


Log Message:


intl doesnt need that - must work on the ability to do language packs
prefix detection. this is the first step to making e17 itself re-locatable
(install anywhere)


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- Makefile.am 12 May 2005 14:46:28 -0000      1.28
+++ Makefile.am 19 May 2005 09:23:53 -0000      1.29
@@ -52,7 +52,8 @@
 e_moveresize.h \
 e_actions.h \
 e_popup.h \
-e_ipc_codec.h
+e_ipc_codec.h \
+e_prefix.h
 
 enlightenment_SOURCES = \
 e_main.c \
@@ -98,6 +99,7 @@
 e_actions.c \
 e_popup.c \
 e_ipc_codec.c \
+e_prefix.c \
 $(ENLIGHTENMENTHEADERS)
 
 enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- e_includes.h        12 May 2005 14:46:28 -0000      1.19
+++ e_includes.h        19 May 2005 09:23:54 -0000      1.20
@@ -43,3 +43,4 @@
 #include "e_popup.h"
 #include "e_ipc_codec.h"
 #include "e_test.h"
+#include "e_prefix.h"
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_intl.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- e_intl.c    3 May 2005 13:19:27 -0000       1.28
+++ e_intl.c    19 May 2005 09:23:54 -0000      1.29
@@ -38,6 +38,9 @@
     *       vs. traditional chinese) we may refer to them as separate languages
     *       entirely.
     */
+   /* FIXME: remove this - hunt locale dirs (a user one in ~/.e/e/ too for
+    * user installed locale support
+    */
    ADD_LANG("");
    ADD_LANG("en_US.UTF-8");
    ADD_LANG("ja_JP.UTF-8");
@@ -71,6 +74,7 @@
 void
 e_intl_language_set(const char *lang)
 {
+   /* FIXME: determine if in user or system locale dir */
    if (_e_intl_language) free(_e_intl_language);
    if (!lang) lang = getenv("LANG");
    if (lang)
@@ -104,132 +108,9 @@
    return _e_intl_language;
 }
 
-#define IFL(l) if (!strcmp(lang, l)) return
-const char *
-e_intl_language_name_get(const char *lang)
-{
-   if (!lang) return "None";
-   /* this is a list of DISTINCT languages. some languages have variants that
-    * are different enough to justify being listed separately as distinct
-    * languages here. this is intended for use in a gui that lets you select
-    * a language, with e being able to give a name for the given language
-    * encoding (once simplfied)
-    */
-   /* FIXME: add as many as we can to this */
-   IFL("") "None";
-   IFL("C") "None";
-   IFL("bg") "Bulgarian";
-   IFL("bs") "Bosnian";
-   IFL("ca") "Catalan";
-   IFL("cs") "Czech";
-   IFL("cy") "Welsh";
-   IFL("da") "Danish";
-   IFL("de") "German";
-   IFL("el") "Greek";
-   IFL("en") "English"; 
-   IFL("es") "Spanish"; 
-   IFL("eu") "Basque";
-   IFL("fa") "Persian";
-   IFL("fr") "French";
-   IFL("fi") "Finnish";
-   IFL("gl") "Galician";
-   IFL("hi") "Hindi";
-   IFL("hr") "Croatian";
-   IFL("hu") "Hungarian";
-   IFL("id") "Indonesian";
-   IFL("it") "Italian";
-   IFL("ja") "Japanese";
-   IFL("kr") "Korean";
-   IFL("lt") "Lithuanian";
-   IFL("lv") "Latvian";
-   IFL("nl") "Dutch";
-   IFL("no") "Norwegian";
-   IFL("nb") "Norwegian Bokmal";
-   IFL("nn") "Norwegian Nynorsk";
-   IFL("pl") "Polish";
-   IFL("pt") "Portuguese";
-   IFL("ro") "Romanian";
-   IFL("ru") "Russian";
-   IFL("sk") "Slovak";
-   IFL("sl") "Slovenian";
-   IFL("sq") "Albanian";
-   IFL("sr") "Serbian";
-   IFL("sv") "Swedish";
-   IFL("tr") "Tuirkish";
-   IFL("uk") "Ukrainian";
-   IFL("vi") "Vietnamese";
-   /* must keep both - politically sensitive */
-   IFL("zh_CN") "Chinese (Simplified)";
-   IFL("zh_TW") "Chinese (Traditional)";
-   return "Unknown";
-}
-
-#define ISL(l) (!strcasecmp(buf, l))
-const char *
-e_intl_language_simple_get(const char *lang)
-{
-   static char buf[128];
-   char *p;
-
-   if (!lang) return "C";
-   /* strip off the charset stuff after any "." eg: "en_US.UTF-8" -> "en_US" */
-   strncpy(buf, lang, sizeof(buf) - 1);
-   p = strchr(buf, '.');
-   if (p) *p = 0;
-   /* do we want to split this inot the different forms of english?
-    * ie american vs british? or australian? etc.
-    */
-   /* for known specific mappings - do them first here */
-   if (ISL("en") || ISL("en_US") || ISL("en_GB") || ISL("[EMAIL PROTECTED]") 
|| 
-       ISL("en_CA") || ISL("en_AU") || ISL("en_NZ") || ISL("en_RN"))
-     return "en";
-   if (ISL("ja") || ISL("ja_JP") || ISL("JP"))
-     return "ja";
-   if (ISL("fr") || ISL("fr_FR") || ISL("FR") || ISL("[EMAIL PROTECTED]"))
-     return "fr";
-   if (ISL("es") || ISL("es_ES") || ISL("ES") || ISL("[EMAIL PROTECTED]") ||
-       ISL("es_AR") || ISL("AR"))
-     return "es";
-   if (ISL("pt") || ISL("pt_PT") || ISL("PT") || ISL("[EMAIL PROTECTED]") ||
-       ISL("pt_BR") || ISL("BR"))
-     return "pt";
-   if (ISL("fi") || ISL("fi_FI") || ISL("FI") || ISL("[EMAIL PROTECTED]"))
-     return "fi";
-   if (ISL("ru") || ISL("ru_RU") || ISL("RU"))
-     return "ru";
-   if (ISL("bg") || ISL("bg_BG") || ISL("BG"))
-     return "bg";
-   if (ISL("de") || ISL("de_DE") || ISL("DE") || ISL("[EMAIL PROTECTED]") ||
-       ISL("de_AT") || ISL("AT") || ISL("[EMAIL PROTECTED]"))
-     return "de";
-   if (ISL("pl") || ISL("pl_PL") || ISL("PL") || ISL("[EMAIL PROTECTED]"))
-     return "pl";
-   if (ISL("zh") || ISL("zh_CN") || ISL("CN"))
-     return "zh_CN";
-   if (ISL("zh") || ISL("zh_TW") || ISL("TW"))
-     return "zh_TW";
-   if (ISL("hu") || ISL("hu_HU") || ISL("HU"))
-     return "hu";
-   if (ISL("sl") || ISL("sl_SI") || ISL("SI"))
-     return "sl";
-   if (ISL("it") || ISL("it_IT") || ISL("IT"))
-     return "it";
-   /* this is the default fallback - we have no special cases for this lang
-    * so just strip off anything after and including the _ for country region
-    * and just return the language encoding
-    */
-   /* strip off anything after a "_" eg: "en_US" -> "en" */
-   p = strchr(buf, '_');
-   if (p) *p = 0;
-   /* we can safely retunr buf because its a static - BUT its contents will
-    * change if we call e_intl_language_simple_get() again - so its only
-    * intended for immediate use and de-reference, not for storage
-    */
-   return buf;
-}
-
 const Evas_List *
 e_intl_language_list(void)
 {
+   /* FIXME: hunt dirs for locales */
    return _e_intl_languages;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_intl.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_intl.h    11 Apr 2005 23:32:24 -0000      1.2
+++ e_intl.h    19 May 2005 09:23:54 -0000      1.3
@@ -17,8 +17,6 @@
 EAPI int e_intl_shutdown(void);
 EAPI void e_intl_language_set(const char *lang);
 EAPI const char *e_intl_language_get(void);
-EAPI const char *e_intl_language_name_get(const char *lang);
-EAPI const char *e_intl_language_simple_get(const char *lang);
 EAPI const Evas_List *e_intl_language_list(void);
     
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -3 -r1.80 -r1.81
--- e_main.c    17 May 2005 11:57:22 -0000      1.80
+++ e_main.c    19 May 2005 09:23:54 -0000      1.81
@@ -69,6 +69,21 @@
    sigaction(SIGSEGV, &sigsegv_action, NULL);
 #endif
 
+   /* FIXME: this is the init code for letting e be relocatable. right now
+    * its not used - so i want to see if it can reliably determine its exe
+    * prefix
+    */
+   if (!e_prefix_determine(argv[0]))
+     {
+       fprintf(stderr,
+               "ERROR: Enlightenment cannot determine its installed\n"
+               "       prefix from the system or argv[0].\n"
+               "       This is because it is not on Linux AND has been\n"
+               "       Executed strangely. This is unusal.\n"
+               );
+       exit(-1);
+     }
+   
    /* for debugging by redirecting stdout of e to a log file to tail */
    setvbuf(stdout, NULL, _IONBF, 0);
       




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to