Use translated strings (choices) in xkb config dialogs from language packs.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 17 Aug 2014 18:32:54 +0000 (21:32 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 17 Aug 2014 18:32:54 +0000 (21:32 +0300)
Many distributions provide language packs which include "xkeyboard-config"
translations. This commit attempts to use it to get dialogs translated.

README
plugins/xkb/xkb-plugin.c

diff --git a/README b/README
index ae4eb59..613a2ca 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 LXPanel is a lightweight X11 desktop panel.
 
-To install this program, two other packages are needed:
-  menu-cache, lxmenu-data.
+To install this program, three other packages are needed:
+  menu-cache, libfm-gtk, lxmenu-data.
 Please install them before installing lxpanel.
 
 There are 2 programs contained in the package.
@@ -27,6 +27,7 @@ About Netstat and Netstatus plugins:
    replacement of netstatus plugin.  It aims to be more usable and resource
    efficient.  At the current stage, netstat runs only on Linux.
 
+
 About theming & lxpanel:
 
 1. In future, hardcoding should not be used for icon lookup. Instead, use Gtk's built-in functions to handle icon lookup. If necessary, provide a fallback (hardcoded) icon.
@@ -44,4 +45,18 @@ About theming & lxpanel:
        *"ns-lock"
        *possibly more, as yet unfound.
 
+3. You can also set theme for any plugin specifically using it's widget name
+    which is equal to plugin name.
+
+4. There is a specific RC file which can be loaded by LXPanel, it can be placed
+    as ~/.config/lxpanel/$PROFILE/gtkrc, where $PROFILE is the profile used on
+    the LXPanel start.
+
 There are also a substantial amount of others, but they use the icon naming specification.
+
+
+About keyboard options translations in xkb plugin:
+
+The 'xkb' plugin can use translations from language packs that are present
+    in many distributions. To use it you should have language pack which
+    includes "xkeyboard-config" translations.
index dafb020..0219436 100644 (file)
@@ -628,7 +628,7 @@ static void on_button_kbd_model_clicked(GtkButton *p_button, gpointer *p_data)
             gtk_list_store_append(p_liststore_kbd_model, &tree_iter);
             gtk_list_store_set(p_liststore_kbd_model, &tree_iter,
                                 COLUMN_MODEL_ID, keys_models[model_idx],
-                                COLUMN_MODEL_DESC, p_model_desc,
+                                COLUMN_MODEL_DESC, g_dgettext("xkeyboard-config", p_model_desc),
                                 -1);
             g_free(p_model_desc);
             model_idx++;
@@ -773,7 +773,7 @@ static void on_button_kbd_change_layout_clicked(GtkButton *p_button, gpointer *p
             }
             gtk_list_store_set(p_liststore_kbd_change, &tree_iter,
                                 COLUMN_CHANGE_ID, keys_changes[change_idx],
-                                COLUMN_CHANGE_DESC, p_change_desc,
+                                COLUMN_CHANGE_DESC, g_dgettext("xkeyboard-config", p_change_desc),
                                 COLUMN_CHANGE_INCL, included,
                                 COLUMN_CHANGE_WEIGHT, included ? PANGO_WEIGHT_ULTRAHEAVY : PANGO_WEIGHT_NORMAL,
                                 -1);
@@ -950,7 +950,7 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
                     gtk_tree_store_set(p_treestore_add_layout, &tree_top,
                                         COLUMN_ADD_ICON, p_pixbuf,
                                         COLUMN_ADD_LAYOUT, keys_layouts[layout_idx],
-                                        COLUMN_ADD_DESC, p_layout_desc,
+                                        COLUMN_ADD_DESC, g_dgettext("xkeyboard-config", p_layout_desc),
                                         -1);
                     g_object_unref(G_OBJECT(p_pixbuf));
                 }