]> Pileus Git - ~andy/gtk/commitdiff
testgmenu: Demonstrate how translatable labels work
authorMatthias Clasen <mclasen@redhat.com>
Tue, 8 Nov 2011 21:28:22 +0000 (16:28 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 19 Dec 2011 17:45:51 +0000 (12:45 -0500)
tests/testgmenu.c

index 821daca51407f5e8739287005708ead7f28623e8..1f8b0d79f385f557b342180a7bc3d77308fd761e 100644 (file)
@@ -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)