From: raster Date: Fri, 25 Mar 2011 04:49:49 +0000 (+0000) Subject: From: WooHyun Jung X-Git-Tag: REL_F_I9500_20120323_1~17^2~3003 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a90a75addf9bb08bbb42daf35747979018f5abcd;p=framework%2Fuifw%2Felementary.git From: WooHyun Jung Subject: [E-devel] [Patch] for Gettext /I18N Mr. Govi in SISO made a patch for following description. Detail Description: 1. If EFL/Elementary Application has i18n String with its own PO file, then Elementary will end up looking for internal Strings at application PO files. Passing PACKAGE name in the Elementary String Look up macro eliminates this issue and looks for internal String from Elm.po files. 2. Macro E_(str) is used, to differentiate the elementary Strings from commonly used #define _(str) in the applications. ( Just E ed :) ) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@58085 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/po/Makevars b/po/Makevars index 22837ab..f128df8 100644 --- a/po/Makevars +++ b/po/Makevars @@ -8,7 +8,7 @@ subdir = po top_builddir = .. # These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 --foreign-user +XGETTEXT_OPTIONS = --keyword=E_ --from-code=UTF-8 --foreign-user # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 9dd5e44..03d18da 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -595,7 +595,7 @@ elm_fileselector_add(Evas_Object *parent) bt = elm_button_add(parent); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); elm_button_icon_set(bt, ic); - elm_button_label_set(bt, _("Up")); + elm_button_label_set(bt, E_("Up")); evas_object_size_hint_align_set(bt, 0.0, 0.0); evas_object_smart_callback_add(bt, "clicked", _up, obj); @@ -610,7 +610,7 @@ elm_fileselector_add(Evas_Object *parent) bt = elm_button_add(parent); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); elm_button_icon_set(bt, ic); - elm_button_label_set(bt, _("Home")); + elm_button_label_set(bt, E_("Home")); evas_object_size_hint_align_set(bt, 0.0, 0.0); evas_object_smart_callback_add(bt, "clicked", _home, obj); @@ -791,7 +791,7 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, // cancel btn bt = elm_button_add(obj); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); - elm_button_label_set(bt, _("Cancel")); + elm_button_label_set(bt, E_("Cancel")); evas_object_smart_callback_add(bt, "clicked", _canc, obj); @@ -801,7 +801,7 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, // ok btn bt = elm_button_add(obj); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); - elm_button_label_set(bt, _("OK")); + elm_button_label_set(bt, E_("OK")); evas_object_smart_callback_add(bt, "clicked", _ok, obj); diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 58346f5..4490fab 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -1535,7 +1535,7 @@ _env_get(void) setlocale(LC_ALL, ""); bindtextdomain("elementary", LOCALE_DIR); textdomain("elementary"); - _elm_config->is_mirrored = !strcmp(_("default:LTR"), "default:RTL"); + _elm_config->is_mirrored = !strcmp(E_("default:LTR"), "default:RTL"); s = getenv("ELM_TOOLTIP_DELAY"); if (s) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 43c95ac..1eae79c 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -876,12 +876,12 @@ _long_press(void *data) if (!wd->selmode) { if (!wd->password) - elm_hoversel_item_add(wd->hoversel, _("Select"), NULL, ELM_ICON_NONE, + elm_hoversel_item_add(wd->hoversel, E_("Select"), NULL, ELM_ICON_NONE, _select, data); if (1) // need way to detect if someone has a selection { if (wd->editable) - elm_hoversel_item_add(wd->hoversel, _("Paste"), NULL, ELM_ICON_NONE, + elm_hoversel_item_add(wd->hoversel, E_("Paste"), NULL, ELM_ICON_NONE, _paste, data); } } @@ -891,13 +891,13 @@ _long_press(void *data) { if (wd->have_selection) { - elm_hoversel_item_add(wd->hoversel, _("Copy"), NULL, ELM_ICON_NONE, + elm_hoversel_item_add(wd->hoversel, E_("Copy"), NULL, ELM_ICON_NONE, _copy, data); if (wd->editable) - elm_hoversel_item_add(wd->hoversel, _("Cut"), NULL, ELM_ICON_NONE, + elm_hoversel_item_add(wd->hoversel, E_("Cut"), NULL, ELM_ICON_NONE, _cut, data); } - elm_hoversel_item_add(wd->hoversel, _("Cancel"), NULL, ELM_ICON_NONE, + elm_hoversel_item_add(wd->hoversel, E_("Cancel"), NULL, ELM_ICON_NONE, _cancel, data); } } diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 6932fda..e19a2c1 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -26,7 +26,7 @@ #define INF(...) EINA_LOG_DOM_INFO(_elm_log_dom, __VA_ARGS__) #define DBG(...) EINA_LOG_DOM_DBG (_elm_log_dom, __VA_ARGS__) -#define _(string) gettext(string) +#define E_(string) dgettext(PACKAGE, string) typedef struct _Elm_Config Elm_Config; typedef struct _Elm_Module Elm_Module;