From 42f78a69806789f3e433b69677a308b0fad1dadf Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Thu, 9 Feb 2017 03:04:04 -0800 Subject: [PATCH] Set textdomain as soon as possible --- xed/xed-app.c | 15 +-------------- xed/xed.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/xed/xed-app.c b/xed/xed-app.c index f5a513d..aebe858 100644 --- a/xed/xed-app.c +++ b/xed/xed-app.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -156,7 +155,7 @@ static const GOptionEntry options[] = /* collects file arguments */ { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, NULL, NULL, - N_("[FILE...] [+LINE") + N_("[FILE...] [+LINE]") }, {NULL} @@ -226,18 +225,6 @@ xed_app_startup (GApplication *application) /* Setup debugging */ xed_debug_init (); xed_debug_message (DEBUG_APP, "Startup"); - - xed_dirs_init (); - - /* Setup locale/gettext */ - setlocale (LC_ALL, ""); - - dir = xed_dirs_get_xed_locale_dir (); - bindtextdomain (GETTEXT_PACKAGE, dir); - - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - xed_debug_message (DEBUG_APP, "Set icon"); dir = xed_dirs_get_xed_data_dir (); diff --git a/xed/xed.c b/xed/xed.c index 7a4ada6..6c1d4ed 100644 --- a/xed/xed.c +++ b/xed/xed.c @@ -33,7 +33,10 @@ #endif #include +#include +#include +#include "xed-dirs.h" #include "xed-app.h" int @@ -41,6 +44,18 @@ main (int argc, char *argv[]) { XedApp *app; gint status; + const gchar *dir; + + xed_dirs_init (); + + /* Setup locale/gettext */ + setlocale (LC_ALL, ""); + + dir = xed_dirs_get_xed_locale_dir (); + bindtextdomain (GETTEXT_PACKAGE, dir); + + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); app = g_object_new (XED_TYPE_APP, "application-id", "org.x.editor",