forked from enlightenment/enlightenment
parent
e701d406d0
commit
cc392c126b
4
po/ja.po
4
po/ja.po
|
@ -442,8 +442,8 @@ msgid ""
|
|||
msgstr ""
|
||||
|
||||
#: src/bin/e_int_menus.c:117
|
||||
msgid "Exit Enlightement"
|
||||
msgstr ""
|
||||
msgid "Exit Enlightenment"
|
||||
msgstr "出口の悟"
|
||||
|
||||
#: src/modules/ibar/e_mod_main.c:775
|
||||
msgid "Exteremely Large"
|
||||
|
|
|
@ -114,7 +114,7 @@ e_int_menus_main_new(void)
|
|||
e_menu_item_callback_set(mi, _e_int_menus_main_restart, NULL);
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Exit Enlightement"));
|
||||
e_menu_item_label_set(mi, _("Exit Enlightenment"));
|
||||
e_menu_item_icon_edje_set(mi, e_path_find(path_icons, "default.edj"),
|
||||
"power");
|
||||
e_menu_item_callback_set(mi, _e_int_menus_main_exit, NULL);
|
||||
|
|
117
src/bin/e_intl.c
117
src/bin/e_intl.c
|
@ -7,15 +7,23 @@
|
|||
/* TODO List:
|
||||
*/
|
||||
|
||||
static char *_e_intl_language = NULL;
|
||||
static Evas_List *_e_intl_languages = NULL;
|
||||
|
||||
#define ADD_LANG(lang) _e_intl_languages = evas_list_append(_e_intl_languages, lang)
|
||||
|
||||
int
|
||||
e_intl_init(void)
|
||||
{
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain(PACKAGE, LOCALE_DIR);
|
||||
textdomain(PACKAGE);
|
||||
// XSetLocaleModifiers("");
|
||||
bind_textdomain_codeset(PACKAGE, "UTF-8");
|
||||
if (_e_intl_languages) return 1;
|
||||
|
||||
/* supporeted languages - as we get translations - add them here */
|
||||
ADD_LANG("C");
|
||||
ADD_LANG("en");
|
||||
ADD_LANG("jp");
|
||||
|
||||
/* FIXME: NULL == use LANG. make this read a config value if it exists */
|
||||
e_intl_language_set(NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -24,3 +32,102 @@ e_intl_shutdown(void)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
e_intl_language_set(const char *lang)
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
if (_e_intl_language) free(_e_intl_language);
|
||||
if (!lang) lang = getenv("LANG");
|
||||
_e_intl_language = strdup(lang);
|
||||
snprintf(buf, sizeof(buf), "LANG=%s", _e_intl_language);
|
||||
putenv(buf);
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain(PACKAGE, LOCALE_DIR);
|
||||
textdomain(PACKAGE);
|
||||
// XSetLocaleModifiers("");
|
||||
bind_textdomain_codeset(PACKAGE, "UTF-8");
|
||||
}
|
||||
|
||||
const char *
|
||||
e_intl_language_get(void)
|
||||
{
|
||||
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";
|
||||
/* FIXME: add as many as we can to this */
|
||||
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("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("jp") "Japanese";
|
||||
IFL("kr") "Korean";
|
||||
IFL("lt") "Lithuanian";
|
||||
IFL("lv") "Latvian";
|
||||
IFL("nl") "Dutch";
|
||||
IFL("nn") "Norwegian Bokmall";
|
||||
IFL("no") "Norwegian Nynorsk";
|
||||
IFL("pl") "Polish";
|
||||
IFL("pt") "Portuguese";
|
||||
IFL("pt_BR") "Portuguese (Brazil)";
|
||||
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";
|
||||
IFL("zh") "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)
|
||||
{
|
||||
char buf[4096], *p;
|
||||
|
||||
if (!lang) return "C";
|
||||
strncpy(buf, lang, sizeof(buf) - 1);
|
||||
p = strchr(buf, '.');
|
||||
if (p) *p = 0;
|
||||
if (ISL("en") || ISL("en_US") || ISL("en_GB") || ISL("en_CA") ||
|
||||
ISL("en_AU") || ISL("en_NZ") || ISL("en_RN"))
|
||||
return "en";
|
||||
if (ISL("ja") || ISL("ja_JP") || ISL("JP") || ISL("en_CA"))
|
||||
return "ja";
|
||||
/* FIXME: add all sorts of fuzzy matching here */
|
||||
return lang;
|
||||
}
|
||||
|
||||
const Evas_List *
|
||||
e_intl_language_list(void)
|
||||
{
|
||||
return _e_intl_languages;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
|
||||
EAPI int e_intl_init(void);
|
||||
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
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue