Revision: 159 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=159&view=rev Author: frlan Date: 2008-09-01 18:02:20 +0000 (Mon, 01 Sep 2008)
Log Message: ----------- GeanyVC: Improved of support for l10n. Thanks to Enrico for patch.
Modified Paths: -------------- trunk/geanyvc/Makefile.am trunk/geanyvc/geanyvc.c
Modified: trunk/geanyvc/Makefile.am =================================================================== --- trunk/geanyvc/Makefile.am 2008-09-01 16:24:17 UTC (rev 158) +++ trunk/geanyvc/Makefile.am 2008-09-01 18:02:20 UTC (rev 159) @@ -20,7 +20,7 @@ geanyvc_la_LDFLAGS = -module -avoid-version geanyvc_la_LIBADD = @GEANY_LIBS@
-AM_CPPFLAGS = @GEANY_CFLAGS@ -DGEANY_DISABLE_DEPRECATED +AM_CPPFLAGS = @GEANY_CFLAGS@ -DGEANY_DISABLE_DEPRECATED -DLOCALEDIR=""$(localedir)""
.PHONY: ChangeLog mrproper
Modified: trunk/geanyvc/geanyvc.c =================================================================== --- trunk/geanyvc/geanyvc.c 2008-09-01 16:24:17 UTC (rev 158) +++ trunk/geanyvc/geanyvc.c 2008-09-01 18:02:20 UTC (rev 159) @@ -2,7 +2,7 @@ * geanyvc.c - Plugin to geany light IDE to work with vc * * Copyright 2007, 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * Copyright 2007 Enrico Tröger enrico.troeger@uvena.de + * Copyright 2007, 2008 Enrico Tröger enrico.troeger@uvena.de * Copyright 2007 Nick Treleaven nick.treleaven@btinternet.com * Copyright 2007, 2008 Yura Siamashka yurand2@gmail.com * @@ -40,6 +40,10 @@ #include "prefs.h" #include "pluginmacros.h"
+#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif + #include "highlighting.h" #include "SciLexer.h"
@@ -1778,6 +1782,31 @@ REGISTER_VC(HG, enable_hg); }
+static void locale_init(void) +{ +#ifdef ENABLE_NLS + gchar *locale_dir = NULL; + +#ifdef 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 */ + locale_dir = g_strconcat(install_dir, "\share\locale", NULL); + g_free(install_dir); +#else + locale_dir = g_strdup(LOCALEDIR); +#endif + + bindtextdomain(GETTEXT_PACKAGE, locale_dir); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + textdomain(GETTEXT_PACKAGE); + g_free(locale_dir); +#endif +} + /* Called by Geany to initialize the plugin */ void plugin_init(G_GNUC_UNUSED GeanyData * data) @@ -1793,6 +1822,8 @@ load_config(); registrate();
+ locale_init(); + tooltips = gtk_tooltips_new();
menu_vc = gtk_image_menu_item_new_with_mnemonic(_("_VC"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.