SF.net SVN: geany:[5879] trunk
frlan at users.sourceforge.net
frlan at xxxxx
Sun Jul 31 17:37:13 UTC 2011
Revision: 5879
http://geany.svn.sourceforge.net/geany/?rev=5879&view=rev
Author: frlan
Date: 2011-07-31 17:37:12 +0000 (Sun, 31 Jul 2011)
Log Message:
-----------
Adding a hint to main_locale_init() to plugin HowTo
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/plugins.dox
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-07-31 17:36:53 UTC (rev 5878)
+++ trunk/ChangeLog 2011-07-31 17:37:12 UTC (rev 5879)
@@ -2,7 +2,7 @@
* doc/plugins.dox:
Adding some content about PLUGIN_SET_TRANSLATABLE_INFO() into plugin
- HowTo.
+ HowTo as well as a hint to make usage of main_locale_init().
Modified: trunk/doc/plugins.dox
===================================================================
--- trunk/doc/plugins.dox 2011-07-31 17:36:53 UTC (rev 5878)
+++ trunk/doc/plugins.dox 2011-07-31 17:37:12 UTC (rev 5879)
@@ -425,4 +425,30 @@
* been agreed to use if possible latin version of author's name
* followed by in case of its apply able nativ spelling inside braces.
*
+ * @subsection plugin_i18n Using i18n/l10n inside Plugin
+ *
+
+ * Not only the meta information of a plugin shall be translateable,
+ * but also the text like menu entries, information boxes or strings
+ * inside configuration dialog should be translateable too. Geany is
+ * offering a way to enable this from code point of view by using a
+ * function provided by the Geany API -- main_locale_init().
+
+ * The function is taking over two parameters LOCALEDIR and
+ * GETTEXT_PACKAGE which we already know from previous sesction.
+
+ * As the function is called best on plugin initialization, it should be
+ * placed into plugin_init() so the hello world example could look like:
+ * @code
+void plugin_init(GeanyData *data)
+{
+ main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
+ main_menu_item = gtk_menu_item_new_with_mnemonic("Hello World");
+ gtk_widget_show(main_menu_item);
+ gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu),
+ main_menu_item);
+ g_signal_connect(main_menu_item, "activate",
+ G_CALLBACK(item_activate_cb), NULL);
+}
+ * @endcode
**/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list