Revision: 158 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=158&view=rev Author: frlan Date: 2008-09-01 16:24:17 +0000 (Mon, 01 Sep 2008)
Log Message: ----------- GeanyLaTeX: Added support for l10n
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2008-09-01 14:03:58 UTC (rev 157) +++ trunk/geanylatex/ChangeLog 2008-09-01 16:24:17 UTC (rev 158) @@ -1,5 +1,10 @@ 2008-09-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+ * src/geanylatex.c: Added support for l10n. + + +2008-09-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * Ported build system of spellcheck plugin.
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2008-09-01 14:03:58 UTC (rev 157) +++ trunk/geanylatex/src/geanylatex.c 2008-09-01 16:24:17 UTC (rev 158) @@ -35,6 +35,10 @@ #include "prefs.h" #include "pluginmacros.h"
+#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif + #include "datatypes.h" #include "letters.h" #include "latexencodings.h" @@ -799,6 +803,31 @@ wizard_activated(NULL, NULL); }
+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 +} + void plugin_init(G_GNUC_UNUSED GeanyData * data) { @@ -812,6 +841,8 @@
tooltips = gtk_tooltips_new();
+ locale_init(); + menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_latex); g_signal_connect((gpointer) menu_latex, "activate", G_CALLBACK(update_menu_items), NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org