[gtk+/wip/gmenu: 10/87] testgmenu: Demonstrate how translatable labels work



commit 596a5eb007faf23b5b4cb74988546ae9db855205
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Nov 8 16:28:22 2011 -0500

    testgmenu: Demonstrate how translatable labels work

 tests/testgmenu.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/tests/testgmenu.c b/tests/testgmenu.c
index 821daca..1f8b0d7 100644
--- a/tests/testgmenu.c
+++ b/tests/testgmenu.c
@@ -387,7 +387,9 @@ menu_holder_get_menu (MenuHolder *holder)
 static const gchar menu_markup[] =
   "<menu id='edit-menu'>\n"
   "  <section>\n"
-  "    <item label='Undo' action='undo'/>\n"
+  "    <item action='undo'>\n"
+  "      <attribute name='label' translatable='yes' context='Stock label'>'_Undo'</attribute>\n"
+  "    </item>\n"
   "    <item label='Redo' action='redo'/>\n"
   "  </section>\n"
   "  <section></section>\n"
@@ -415,7 +417,7 @@ start_element (GMarkupParseContext *context,
                GError             **error)
 {
   if (strcmp (element_name, "menu") == 0)
-    g_menu_markup_parser_start_menu (context, NULL);
+    g_menu_markup_parser_start_menu (context, "gtk30", NULL);
 }
 
 static void
@@ -453,7 +455,7 @@ get_model (void)
    return G_MENU_MODEL (menu);
 }
 
-/* The example actions {{{1 */
+ /* The example actions {{{1 */
 
 static void
 activate_action (GSimpleAction *action, GVariant *parameter, gpointer user_data)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]