diff --git a/clutter/clutter/clutter-build-config.h.meson b/clutter/clutter/clutter-build-config.h.meson index 7ca19deab..a859f78f9 100644 --- a/clutter/clutter/clutter-build-config.h.meson +++ b/clutter/clutter/clutter-build-config.h.meson @@ -1,3 +1,6 @@ +/* The prefix for our gettext translation domains. */ +#mesondefine GETTEXT_PACKAGE + /* Mutter version */ #mesondefine MUTTER_VERSION diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index fbccefc0d..be9f74441 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -50,6 +50,7 @@ #include "clutter-build-config.h" #include +#include #include "clutter-actor-private.h" #include "clutter-backend-private.h" @@ -204,7 +205,7 @@ clutter_context_get_pango_fontmap (void) return self->font_map; } -static ClutterTextDirection +ClutterTextDirection clutter_get_text_direction (void) { ClutterTextDirection dir = CLUTTER_TEXT_DIRECTION_LTR; @@ -220,8 +221,13 @@ clutter_get_text_direction (void) } else { - /* Re-use GTK+'s LTR/RTL handling */ - const char *e = g_dgettext ("gtk30", "default:LTR"); + /* + * Translate to default:RTL if you want your widgets + * to be RTL, otherwise translate to default:LTR. + * Do *not* translate it to "predefinito:LTR", if it + * it isn't default:LTR or default:RTL it will not work + */ + const char *e = _("default:LTR"); if (strcmp (e, "default:RTL") == 0) dir = CLUTTER_TEXT_DIRECTION_RTL; diff --git a/clutter/clutter/clutter-main.h b/clutter/clutter/clutter-main.h index a9b97eb1b..b9854956b 100644 --- a/clutter/clutter/clutter-main.h +++ b/clutter/clutter/clutter-main.h @@ -148,6 +148,9 @@ void clutter_remove_debug_flags (ClutterDebugFla CLUTTER_EXPORT void clutter_debug_set_max_render_time_constant (int max_render_time_constant_us); +CLUTTER_EXPORT +ClutterTextDirection clutter_get_text_direction (void); + G_END_DECLS #endif /* _CLUTTER_MAIN_H__ */ diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build index b4ee4b782..854e4918f 100644 --- a/clutter/clutter/meson.build +++ b/clutter/clutter/meson.build @@ -267,6 +267,7 @@ clutter_built_private_headers = [] cdata = configuration_data() cdata.set_quoted('MUTTER_VERSION', meson.project_version()) +cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name()) cdata.set('CLUTTER_DRIVERS', '"*"') cdata.set('HAVE_PANGO_FT2', have_pango_ft2) diff --git a/po/POTFILES.in b/po/POTFILES.in index ebafa966e..d671ba4ab 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,6 +11,7 @@ src/backends/meta-input-settings.c src/backends/meta-monitor.c src/backends/meta-monitor-manager.c src/backends/x11/meta-clutter-backend-x11.c +src/clutter/clutter/clutter-main.c src/compositor/compositor.c src/compositor/meta-background.c src/core/bell.c diff --git a/src/core/util.c b/src/core/util.c index 5b62279ec..ea26bc2f0 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -508,11 +508,11 @@ meta_external_binding_name_for_action (guint keybinding_action) MetaLocaleDirection meta_get_locale_direction (void) { - switch (gtk_get_locale_direction ()) + switch (clutter_get_text_direction ()) { - case GTK_TEXT_DIR_LTR: + case CLUTTER_TEXT_DIRECTION_LTR: return META_LOCALE_DIRECTION_LTR; - case GTK_TEXT_DIR_RTL: + case CLUTTER_TEXT_DIRECTION_RTL: return META_LOCALE_DIRECTION_RTL; default: g_assert_not_reached ();