_elm_rescale();
}
+static void
+_translation_init()
+{
+#ifdef ENABLE_NLS
+ const char *cur_dom = textdomain(NULL);
+ const char *trans_comment = gettext("");
+ const char *msg_locale = setlocale(LC_MESSAGES, NULL);
+
+ /* Same concept as what glib does:
+ * We shouldn't translate if there are no translations for the
+ * application in the current locale + domain. (Unless locale is
+ * en_/C where translating only parts of the interface make some
+ * sense).
+ */
+ _elm_config->translate = !(strcmp (cur_dom, "messages") &&
+ !*trans_comment && strncmp (msg_locale, "en_", 3) &&
+ strcmp (msg_locale, "C"));
+#endif
+}
+
void
_elm_config_init(void)
{
_desc_init();
_profile_fetch_from_conf();
_config_load();
+ _translation_init();
_env_get();
_config_apply();
_elm_config_font_overlay_apply();
#ifdef ENABLE_NLS
# include <libintl.h>
-# define E_(string) dgettext(PACKAGE, string)
+# define E_(string) _elm_dgettext(string)
#else
# define bindtextdomain(domain,dir)
# define E_(string) (string)
/* Not part of the EET file */
Eina_Bool is_mirrored : 1;
+ Eina_Bool translate : 1;
};
struct _Elm_Module
extern Eina_List *_elm_win_list;
extern int _elm_win_deferred_free;
+/* Our gettext wrapper, used to disable translation of elm if the app
+ * is not translated. */
+static inline const char *
+_elm_dgettext(const char *string)
+{
+ if (EINA_UNLIKELY(_elm_config->translate == EINA_FALSE))
+ {
+ return string;
+ }
+
+ return dgettext(PACKAGE, string);
+}
+
+
/* Used by the paste handler */
void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);