GNOME Bugzilla – Bug 300224
GTK+ should allow for accelerator key names to be translated
Last modified: 2011-02-04 16:18:46 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.
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().
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)