SF.net SVN: geany:[5757] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue May 3 15:18:52 UTC 2011


Revision: 5757
          http://geany.svn.sourceforge.net/geany/?rev=5757&view=rev
Author:   ntrel
Date:     2011-05-03 15:18:52 +0000 (Tue, 03 May 2011)

Log Message:
-----------
Allow translations for color scheme [theme_info] keys.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/highlighting.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-05-02 16:46:34 UTC (rev 5756)
+++ trunk/ChangeLog	2011-05-03 15:18:52 UTC (rev 5757)
@@ -1,3 +1,9 @@
+2011-05-03  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/highlighting.c, doc/geany.txt, doc/geany.html:
+   Allow translations for color scheme [theme_info] keys.
+
+
 2011-05-02  Colomban Wendling  <colomban(at)geany(dot)org>
 
  * src/plugindata.h:

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2011-05-02 16:46:34 UTC (rev 5756)
+++ trunk/doc/geany.html	2011-05-03 15:18:52 UTC (rev 5757)
@@ -1901,7 +1901,13 @@
 </div>
 <p>The <tt class="docutils literal"><span class="pre">[theme_info]</span></tt> section can contain information about the
 theme. The <tt class="docutils literal"><span class="pre">name</span></tt> and <tt class="docutils literal"><span class="pre">description</span></tt> keys are read to set the
-menu item text and tooltip, respectively.</p>
+menu item text and tooltip, respectively. These keys can have
+translations, e.g.:</p>
+<pre class="literal-block">
+key=Hello
+key[de]=Hallo
+key[fr_FR]=Bonjour
+</pre>
 </div>
 </div>
 <div class="section">
@@ -6560,7 +6566,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2011-04-30 16:23 UTC.
+Generated on: 2011-05-03 15:15 UTC.
 Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2011-05-02 16:46:34 UTC (rev 5756)
+++ trunk/doc/geany.txt	2011-05-03 15:18:52 UTC (rev 5757)
@@ -1489,8 +1489,13 @@
 
 The ``[theme_info]`` section can contain information about the
 theme. The ``name`` and ``description`` keys are read to set the
-menu item text and tooltip, respectively.
+menu item text and tooltip, respectively. These keys can have
+translations, e.g.::
 
+    key=Hello
+    key[de]=Hallo
+    key[fr_FR]=Bonjour
+
 Tags
 ----
 

Modified: trunk/src/highlighting.c
===================================================================
--- trunk/src/highlighting.c	2011-05-02 16:46:34 UTC (rev 5756)
+++ trunk/src/highlighting.c	2011-05-03 15:18:52 UTC (rev 5757)
@@ -3627,6 +3627,15 @@
 }
 
 
+static gchar *utils_get_setting_locale_string(GKeyFile *keyfile,
+		const gchar *group, const gchar *key, const gchar *default_value)
+{
+	gchar *result = g_key_file_get_locale_string(keyfile, group, key, NULL, NULL);
+
+	return NVL(result, g_strdup(default_value));
+}
+
+
 static void add_color_scheme_item(GtkWidget *menu, const gchar *fname)
 {
 	static GSList *group = NULL;
@@ -3647,11 +3656,11 @@
 		setptr(path, utils_build_path(app->datadir, GEANY_COLORSCHEMES_SUBDIR, fname, NULL));
 		skeyfile = utils_key_file_new(path);
 
-		theme_name = utils_get_setting(string, hkeyfile, skeyfile, "theme_info", "name", theme_fn);
+		theme_name = utils_get_setting(locale_string, hkeyfile, skeyfile, "theme_info", "name", theme_fn);
 		item = gtk_radio_menu_item_new_with_label(group, theme_name);
 		g_object_set_data_full(G_OBJECT(item), "colorscheme_file", theme_fn, g_free);
 
-		tooltip = utils_get_setting(string, hkeyfile, skeyfile, "theme_info", "description", NULL);
+		tooltip = utils_get_setting(locale_string, hkeyfile, skeyfile, "theme_info", "description", NULL);
 		if (tooltip != NULL)
 		{
 			ui_widget_set_tooltip_text(item, tooltip);


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