Commit 79d82223 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Generate N_() calls for translatable key names.

2005-06-10  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gen-keyname-table.pl: Generate N_() calls for
	translatable key names.

	* gdk/keynames.txt: Mark some key names as translatable.

	* gdk/keyname-table.h: Regenerated.

	* gtk/gtkaccellabel.c (gtk_accel_label_class_init): Add
	some context to the msg ids for keyboard modifiers and
	key names.
	(_gtk_accel_label_class_get_accelerator_label): Try to
	translate key names.  (#300224, Christian Rose)
parent ab44ea2b
2005-06-10 Matthias Clasen <mclasen@redhat.com>
* gdk/gen-keyname-table.pl: Generate N_() calls for
translatable key names.
* gdk/keynames.txt: Mark some key names as translatable.
* gdk/keyname-table.h: Regenerated.
* gtk/gtkaccellabel.c (gtk_accel_label_class_init): Add
some context to the msg ids for keyboard modifiers and
key names.
(_gtk_accel_label_class_get_accelerator_label): Try to
translate key names. (#300224, Christian Rose)
2005-06-10 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-6:
......
2005-06-10 Matthias Clasen <mclasen@redhat.com>
* gdk/gen-keyname-table.pl: Generate N_() calls for
translatable key names.
* gdk/keynames.txt: Mark some key names as translatable.
* gdk/keyname-table.h: Regenerated.
* gtk/gtkaccellabel.c (gtk_accel_label_class_init): Add
some context to the msg ids for keyboard modifiers and
key names.
(_gtk_accel_label_class_get_accelerator_label): Try to
translate key names. (#300224, Christian Rose)
2005-06-10 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-6:
......
2005-06-10 Matthias Clasen <mclasen@redhat.com>
* gdk/gen-keyname-table.pl: Generate N_() calls for
translatable key names.
* gdk/keynames.txt: Mark some key names as translatable.
* gdk/keyname-table.h: Regenerated.
* gtk/gtkaccellabel.c (gtk_accel_label_class_init): Add
some context to the msg ids for keyboard modifiers and
key names.
(_gtk_accel_label_class_get_accelerator_label): Try to
translate key names. (#300224, Christian Rose)
2005-06-10 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-6:
......
......@@ -7,13 +7,18 @@ if (@ARGV != 1) {
open IN, $ARGV[0] || die "Cannot open $ARGV[0]: $!\n";
@keys = ();
@translate = ();
while (defined($_ = <IN>)) {
next if /^!/;
if (!/^\s*(0x[0-9a-f]+)\s+(.*\S)\s+$/) {
if (!/^\s*(0x[0-9a-f]+)\s+([\w_]*\S)\s+(1)?\s*$/) {
die "Cannot parse line $_";
}
push @keys, [$1, $2];
if (defined ($3)) {
push @translate, $2;
}
}
$offset = 0;
......@@ -88,5 +93,22 @@ for $key (@keys) {
$i++;
}
print "\n};\n";
print <<EOT;
};
#if 0
EOT
for $key (@translate) {
print <<EOT;
N_("keyboard label|$key")
EOT
}
print <<EOT;
#endif
EOT
/* keyname-table.h: Generated by gen-keyname-table.pl from keynames.txt
*
* Date: Tue Mar 8 04:19:59 2005
* Date: Fri Jun 10 05:49:14 2005
*
* Do not edit.
*/
......@@ -3932,5 +3932,43 @@ static const gdk_key gdk_keys_by_name[] = {
{ 0x00007a, 383 },
{ 0x0001bf, 1456 },
{ 0x0001bc, 1430 },
{ 0x0001be, 1449 }
};
{ 0x0001be, 1449 }};
#if 0
N_("keyboard label|BackSpace")
N_("keyboard label|Tab")
N_("keyboard label|Return")
N_("keyboard label|Pause")
N_("keyboard label|Scroll_Lock")
N_("keyboard label|Sys_Req")
N_("keyboard label|Escape")
N_("keyboard label|Multi_key")
N_("keyboard label|Home")
N_("keyboard label|Page_Up")
N_("keyboard label|Page_Down")
N_("keyboard label|End")
N_("keyboard label|Begin")
N_("keyboard label|Print")
N_("keyboard label|Insert")
N_("keyboard label|Num_Lock")
N_("keyboard label|KP_Space")
N_("keyboard label|KP_Tab")
N_("keyboard label|KP_Enter")
N_("keyboard label|KP_Home")
N_("keyboard label|KP_Left")
N_("keyboard label|KP_Up")
N_("keyboard label|KP_Right")
N_("keyboard label|KP_Down")
N_("keyboard label|KP_Page_Up")
N_("keyboard label|KP_Prior")
N_("keyboard label|KP_Page_Down")
N_("keyboard label|KP_Next")
N_("keyboard label|KP_End")
N_("keyboard label|KP_Begin")
N_("keyboard label|KP_Insert")
N_("keyboard label|KP_Delete")
N_("keyboard label|Delete")
#endif
......@@ -1143,16 +1143,16 @@
0x00fefb Pointer_DfltBtnNext
0x00fefc Pointer_DfltBtnPrev
0x00fefd Pointer_Drag5
0x00ff08 BackSpace
0x00ff09 Tab
0x00ff08 BackSpace 1
0x00ff09 Tab 1
0x00ff0a Linefeed
0x00ff0b Clear
0x00ff0d Return
0x00ff13 Pause
0x00ff14 Scroll_Lock
0x00ff15 Sys_Req
0x00ff1b Escape
0x00ff20 Multi_key
0x00ff0d Return 1
0x00ff13 Pause 1
0x00ff14 Scroll_Lock 1
0x00ff15 Sys_Req 1
0x00ff1b Escape 1
0x00ff20 Multi_key 1
0x00ff21 Kanji
0x00ff22 Muhenkan
0x00ff23 Henkan
......@@ -1185,21 +1185,21 @@
0x00ff3d MultipleCandidate
0x00ff3e PreviousCandidate
0x00ff3f Hangul_Special
0x00ff50 Home
0x00ff50 Home 1
0x00ff51 Left
0x00ff52 Up
0x00ff53 Right
0x00ff54 Down
0x00ff55 Page_Up
0x00ff55 Page_Up 1
0x00ff55 Prior
0x00ff56 Page_Down
0x00ff56 Page_Down 1
0x00ff56 Next
0x00ff57 End
0x00ff58 Begin
0x00ff57 End 1
0x00ff58 Begin 1
0x00ff60 Select
0x00ff61 Print
0x00ff61 Print 1
0x00ff62 Execute
0x00ff63 Insert
0x00ff63 Insert 1
0x00ff65 Undo
0x00ff66 Redo
0x00ff67 Menu
......@@ -1215,27 +1215,27 @@
0x00ff7e Mode_switch
0x00ff7e kana_switch
0x00ff7e script_switch
0x00ff7f Num_Lock
0x00ff80 KP_Space
0x00ff89 KP_Tab
0x00ff8d KP_Enter
0x00ff7f Num_Lock 1
0x00ff80 KP_Space 1
0x00ff89 KP_Tab 1
0x00ff8d KP_Enter 1
0x00ff91 KP_F1
0x00ff92 KP_F2
0x00ff93 KP_F3
0x00ff94 KP_F4
0x00ff95 KP_Home
0x00ff96 KP_Left
0x00ff97 KP_Up
0x00ff98 KP_Right
0x00ff99 KP_Down
0x00ff9a KP_Page_Up
0x00ff9a KP_Prior
0x00ff9b KP_Page_Down
0x00ff9b KP_Next
0x00ff9c KP_End
0x00ff9d KP_Begin
0x00ff9e KP_Insert
0x00ff9f KP_Delete
0x00ff95 KP_Home 1
0x00ff96 KP_Left 1
0x00ff97 KP_Up 1
0x00ff98 KP_Right 1
0x00ff99 KP_Down 1
0x00ff9a KP_Page_Up 1
0x00ff9a KP_Prior 1
0x00ff9b KP_Page_Down 1
0x00ff9b KP_Next 1
0x00ff9c KP_End 1
0x00ff9d KP_Begin 1
0x00ff9e KP_Insert 1
0x00ff9f KP_Delete 1
0x00ffaa KP_Multiply
0x00ffab KP_Add
0x00ffac KP_Separator
......@@ -1302,5 +1302,5 @@
0x00ffec Super_R
0x00ffed Hyper_L
0x00ffee Hyper_R
0x00ffff Delete
0x00ffff Delete 1
0xffffff VoidSymbol
......@@ -116,20 +116,23 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class)
* that use the shift key. If the text on this key isn't typically
* translated on keyboards used for your language, don't translate
* this.
* And do not translate the part before the |.
*/
class->mod_name_shift = g_strdup (_("Shift"));
class->mod_name_shift = g_strdup (Q_("keyboard label|Shift"));
/* This is the text that should appear next to menu accelerators
* that use the control key. If the text on this key isn't typically
* translated on keyboards used for your language, don't translate
* this.
* And do not translate the part before the |.
*/
class->mod_name_control = g_strdup (_("Ctrl"));
class->mod_name_control = g_strdup (Q_("keyboard label|Ctrl"));
/* This is the text that should appear next to menu accelerators
* that use the alt key. If the text on this key isn't typically
* translated on keyboards used for your language, don't translate
* this.
* And do not translate the part before the |.
*/
class->mod_name_alt = g_strdup (_("Alt"));
class->mod_name_alt = g_strdup (Q_("keyboard label|Alt"));
class->mod_separator = g_strdup ("+");
class->accel_seperator = g_strdup (" / ");
class->latin1_to_char = TRUE;
......@@ -570,10 +573,12 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
switch (ch)
{
case ' ':
g_string_append (gstring, "Space");
/* do not translate the part before the | */
g_string_append (gstring, Q_("keyboard label|Space"));
break;
case '\\':
g_string_append (gstring, "Backslash");
/* do not translate the part before the | */
g_string_append (gstring, Q_("keyboard label|Backslash"));
break;
default:
g_string_append_unichar (gstring, g_unichar_toupper (ch));
......@@ -583,13 +588,22 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
else
{
gchar *tmp;
tmp = gtk_accelerator_name (accelerator_key, 0);
if (tmp[0] != 0 && tmp[1] == 0)
tmp = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
if (tmp == NULL)
tmp = "";
else if (tmp[0] != 0 && tmp[1] == 0)
tmp[0] = g_ascii_toupper (tmp[0]);
substitute_underscores (tmp);
else
{
gchar msg[128];
strcpy (msg, "keyboard label|");
g_strlcat (msg, tmp, 128);
tmp = g_strip_context (msg, dgettext (GETTEXT_PACKAGE, msg));
substitute_underscores (tmp);
}
g_string_append (gstring, tmp);
g_free (tmp);
}
return g_string_free (gstring, FALSE);
......
2005-06-10 Matthias Clasen <mclasen@redhat.com>
* POTFILES.in: Add gdk/keyname-table.h
2005-06-08 Priit Laes <plaes@cvs.gnome.org>
* et.po: Translation updated by Ivar Smolin.
......
......@@ -23,6 +23,7 @@ gdk-pixbuf/io-xpm.c
gdk/gdk.c
gdk/gdkdisplaymanager.c
gdk/gdkpango.c
gdk/keyname-table.h
gdk/win32/gdkmain-win32.c
gdk/x11/gdkmain-x11.c
gtk/gtkaboutdialog.c
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment