From: WooHyun Jung <wh0705.jung@samsung.com>
authorWooHyun Jung <wh0705.jung@samsung.com>
Fri, 25 Mar 2011 04:49:49 +0000 (04:49 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Fri, 25 Mar 2011 04:49:49 +0000 (04:49 +0000)
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 :) )

SVN revision: 58085

po/Makevars
src/lib/elc_fileselector.c
src/lib/elm_config.c
src/lib/elm_entry.c
src/lib/elm_priv.h

index 22837aba49c422227e7ffef4c8e8ec1ec61ca6f1..f128df819c7bb34980c5165bab3173a105733993 100644 (file)
@@ -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
index 9dd5e440f22773391ae16393cd232977f3febe0d..03d18daf6d31196f001ed453ead34cdd4b1b02ce 100644 (file)
@@ -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);
 
index 58346f5e437c595bd4520a1399c3a2161d69d6e7..4490fab8b470e05db50e06fd4bc3da26926681b7 100644 (file)
@@ -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)
index 43c95acbb7d40eb2f108a8d308c82440e2f08e12..1eae79c702d54ca23f1b70feadd6e45eb818d319 100644 (file)
@@ -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);
                }
           }
index 6932fda6ae591404e9d8a01b8f60952e28eacf83..e19a2c1226724c37ab3ed9e0da17593c7cbbd3af 100644 (file)
@@ -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;