[gedit] Set textdomain as soon as possible
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Set textdomain as soon as possible
- Date: Tue, 5 Aug 2014 12:11:03 +0000 (UTC)
commit 279ee18780fd21a0cb6badec925f79f866a55144
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Aug 5 14:10:09 2014 +0200
Set textdomain as soon as possible
startup is too late and we might get the menus not translated
gedit/gedit-app.c | 12 ------------
gedit/gedit.c | 15 +++++++++++++++
2 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index a5bb53b..81b2520 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -25,7 +25,6 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <locale.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
@@ -481,17 +480,6 @@ gedit_app_startup (GApplication *application)
gedit_debug_init ();
gedit_debug_message (DEBUG_APP, "Startup");
- gedit_dirs_init ();
-
- /* Setup locale/gettext */
- setlocale (LC_ALL, "");
-
- dir = gedit_dirs_get_gedit_locale_dir ();
- bindtextdomain (GETTEXT_PACKAGE, dir);
-
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
gedit_debug_message (DEBUG_APP, "Set icon");
dir = gedit_dirs_get_gedit_data_dir ();
diff --git a/gedit/gedit.c b/gedit/gedit.c
index 5d2806a..dc065c2 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -23,7 +23,10 @@
#endif
#include <glib.h>
+#include <locale.h>
+#include <libintl.h>
+#include "gedit-dirs.h"
#include "gedit-app.h"
#ifdef OS_OSX
#include "gedit-app-osx.h"
@@ -93,6 +96,18 @@ main (int argc, char *argv[])
GType type;
GeditApp *app;
gint status;
+ const gchar *dir;
+
+ gedit_dirs_init ();
+
+ /* Setup locale/gettext */
+ setlocale (LC_ALL, "");
+
+ dir = gedit_dirs_get_gedit_locale_dir ();
+ bindtextdomain (GETTEXT_PACKAGE, dir);
+
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
#ifdef OS_OSX
type = GEDIT_TYPE_APP_OSX;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]