Revision: 1640 http://svn.sourceforge.net/geany/?rev=1640&view=rev Author: eht16 Date: 2007-06-25 10:49:45 -0700 (Mon, 25 Jun 2007)
Log Message: ----------- Use setlocale to enable translation of strings before GLib command line parser gets active.
Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-24 13:58:30 UTC (rev 1639) +++ trunk/ChangeLog 2007-06-25 17:49:45 UTC (rev 1640) @@ -1,3 +1,9 @@ +2007-06-25 Enrico Tröger enrico.troeger@uvena.de + + * src/main.c: Use setlocale to enable translation of strings before + GLib command line parser gets active. + + 2007-06-24 Enrico Tröger enrico.troeger@uvena.de
* geany.nsi: Fix wrong working directory in generated shortcuts.
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2007-06-24 13:58:30 UTC (rev 1639) +++ trunk/src/main.c 2007-06-25 17:49:45 UTC (rev 1640) @@ -35,6 +35,10 @@
#include "geany.h"
+#if HAVE_LOCALE_H +# include <locale.h> +#endif + #include "main.h" #include "interface.h" #include "support.h" @@ -69,10 +73,11 @@ # include "vte.h" #endif
-#define N_(String) (String) +#ifndef N_ +# define N_(String) (String) +#endif
- CommandLineOptions cl_options; // fields initialised in parse_command_line_options
static gboolean debug_mode = FALSE; @@ -405,8 +410,13 @@
static void locale_init() { +#ifdef ENABLE_NLS gchar *locale_dir = NULL;
+#if HAVE_LOCALE_H + setlocale(LC_ALL, ""); +#endif + #ifdef G_OS_WIN32 gchar *install_dir = g_win32_get_package_installation_directory("geany", NULL); // e.g. C:\Program Files\geany\lib\locale @@ -416,12 +426,11 @@ locale_dir = g_strdup(PACKAGE_LOCALE_DIR); #endif
-#ifdef ENABLE_NLS bindtextdomain(GETTEXT_PACKAGE, locale_dir); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); + g_free(locale_dir); #endif - g_free(locale_dir); }
@@ -435,7 +444,7 @@ cl_options.goto_line = -1; cl_options.goto_column = -1;
- context = g_option_context_new(_(" - A fast and lightweight IDE")); + context = g_option_context_new(_("[FILES...]")); g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE); g_option_group_set_translation_domain(g_option_context_get_main_group(context), GETTEXT_PACKAGE); g_option_context_add_group(context, gtk_get_option_group(TRUE));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.