diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-06-10 06:41:04 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-06-10 06:41:04 +0000 |
commit | 79d82223a23527721dcc72cf973e1c3075eb1a20 (patch) | |
tree | bb55babc5850c7e50227366ebbd179ab78260cb9 /gdk/gen-keyname-table.pl | |
parent | ab44ea2b8cbe72aee536ef478a95c6b0c445a376 (diff) | |
download | gtk+-79d82223a23527721dcc72cf973e1c3075eb1a20.tar.gz |
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)
Diffstat (limited to 'gdk/gen-keyname-table.pl')
-rwxr-xr-x | gdk/gen-keyname-table.pl | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gdk/gen-keyname-table.pl b/gdk/gen-keyname-table.pl index 9a85f3af7c..e0fe9642b2 100755 --- a/gdk/gen-keyname-table.pl +++ b/gdk/gen-keyname-table.pl @@ -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 |