[gedit] main: create setup_i18n() function
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] main: create setup_i18n() function
- Date: Tue, 12 Nov 2019 15:56:14 +0000 (UTC)
commit 9e9d41af2776556dd9187461f377464e51a9b8be
Author: Sébastien Wilmet <swilmet gnome org>
Date: Tue Nov 12 16:23:36 2019 +0100
main: create setup_i18n() function
gedit/gedit.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/gedit/gedit.c b/gedit/gedit.c
index 93d0db926..8c6726ebe 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -99,13 +99,26 @@ gedit_w32_unload_private_dll (void)
}
#endif /* G_OS_WIN32 */
+static void
+setup_i18n (void)
+{
+ const gchar *dir;
+
+ setlocale (LC_ALL, "");
+
+ dir = gedit_dirs_get_gedit_locale_dir ();
+ bindtextdomain (GETTEXT_PACKAGE, dir);
+
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+}
+
int
main (int argc, char *argv[])
{
GType type;
GeditApp *app;
gint status;
- const gchar *dir;
#if defined OS_OSX
type = GEDIT_TYPE_APP_OSX;
@@ -124,14 +137,8 @@ main (int argc, char *argv[])
* private library is loaded */
gedit_dirs_init ();
- /* Setup locale/gettext */
- setlocale (LC_ALL, "");
-
- dir = gedit_dirs_get_gedit_locale_dir ();
- bindtextdomain (GETTEXT_PACKAGE, dir);
+ setup_i18n ();
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
app = g_object_new (type,
"application-id", "org.gnome.gedit",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]