After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 300224 - GTK+ should allow for accelerator key names to be translated
GTK+ should allow for accelerator key names to be translated
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 153259
 
 
Reported: 2005-04-11 17:29 UTC by Christian Rose
Modified: 2011-02-04 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Rose 2005-04-11 17:29:08 UTC
GTK+ should allow for accelerator key names to be translated, so that
translators can translate the names of keyboard keys ("Escape", "Insert",
"Home", "Page Up", "Delete", "End", "Page Down", "Print Screen", "Scroll Lock",
"Pause", etc...) into the printed names that these keys usually have on
keyboards for that language.

Then, applications that use a particular accelerator (such as "Ctrl+Delete")
would be able to show the translated version ("Strg+Entf") in the UI. See bug
153259 for another, actual example, and a screenshot and some discussion as well.

GTK+ already provides a means for translators to translate the key names "Ctrl",
"Alt", "Shift" (see gtk/gtkaccellabel.c); perhaps that should be extended to
cover other keyboard keys as well.
Comment 1 Matthias Clasen 2005-06-09 17:53:01 UTC
The functions to look at for this are

_gtk_accel_label_class_get_accelerator_label() which does the translation
of "Alt" and "Ctrl" (these should probably use Q_() to give translators some
context that we're talking about key syms here.  

the names of the other keys come in via gtk_accelerator_name() which really
just calls gdk_keyval_name().
Comment 2 Matthias Clasen 2005-06-10 06:41:16 UTC
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)