metacity r3657 - in trunk: . src/ui



Author: tthurman
Date: Fri Mar 21 02:56:52 2008
New Revision: 3657
URL: http://svn.gnome.org/viewvc/metacity?rev=3657&view=rev

Log:
2008-03-21  Thomas Thurman  <tthurman gnome org>

        * src/ui/menu.c (activate_cb, get_workspace_name_with_accel): Workspaces
	whose name is the standard name plus a non-empty string are handled
	correctly in menus.  Closes #453678.



Modified:
   trunk/ChangeLog
   trunk/src/ui/menu.c

Modified: trunk/src/ui/menu.c
==============================================================================
--- trunk/src/ui/menu.c	(original)
+++ trunk/src/ui/menu.c	Fri Mar 21 02:56:52 2008
@@ -177,6 +177,9 @@
  * 
  * The calling code owns the string, and is reponsible to free the
  * memory after use.
+ *
+ * See also http://mail.gnome.org/archives/gnome-i18n/2008-March/msg00380.html
+ * which discusses possible i18n concerns.
  */
 static char*
 get_workspace_name_with_accel (Display *display,
@@ -185,6 +188,7 @@
 {
   const char *name;
   int number;
+  int charcount=0;
 
   name = meta_core_get_workspace_name_with_index (display, xroot, index);
 
@@ -196,7 +200,8 @@
    * return it
    */
   number = 0;
-  if (sscanf (name, _("Workspace %d"), &number) == 1)
+  if (sscanf (name, _("Workspace %d%n"), &number, &charcount) != 0 &&
+      *(name + charcount)=='\0')
     {
       char *new_name;
       
@@ -241,7 +246,7 @@
           *dest++ = *source++;
         }
 
-      /* People don't start at workstation 0, but workstation 1 */
+      /* People don't start at workspace 0, but workspace 1 */
       if (index < 9)
         {
           g_snprintf (dest, 6, " (_%d)", index + 1);



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