Accelerator Keys
An accelerator key is visible in an application as a letter with an underscore.
If you press that letter you are taken to that item. For example Alt-F usually
takes you to the file menu. Then pressing A will open the 'Save As...' dialogue
box.
Identifying
In translation accelerator keys are shown by various characters. In KDE they use
the ampersand (&), Gnome uses underscore (_) and OpenOffice.org uses tilde (~).
Here is a KDE example:
"Save &As..."
Pressing A would take you to the Save As dialogue box.
What happens if you want to use the & character without making it an accelerator? In
this case the accelerator is usually escaped by using &&.
Eg "Mail && News". In this case as a translator you would be free to drop the &
and use the equivalent of 'and' in your language.
Selecting
How do you select an accelerator key for your languages? We usually follow these simple
rules.
1) Try to keep the same position as the original. Eg "&File" -> "&Ifayile"
2) Try to keep the same letter as the original. Eg "&File" -> "I&fayile"
3) Select an uncommon letter. In Xhosa the letter I occurs frequently so we
try to avoid using it too much
4) No available character. Usually in Asian languages where a keyboard is Western.
Translate the word into your language and use the original English accelerator.
Ie "&File" -> "XXXX(&F)". In Mozilla you can safely ignore defining the accelerator
in which case it will default to the English version (TODO: validate this :)
Checking
The pofilter tool has an accelerator test. This will check for missing
accelerators as well as accelerators that shouldn't be in the translation. The
tool can tell the difference between the various accelerator keys used.
pofilter --mozilla -t accelerators -i original -o accelerator-errors
This will check for Mozilla PO style accelerators (&) in the 'original'
directory and output any errors to a new directory called 'accelerator-errors'
Please check the pofilter documentation for more details on how to use this tool.
Errors
What happens if you select the same accelerator key for two different components? How
do you check this?
Firstly, its not a train smash. Once the application is fully translated these
conflicts should sort themselves out over time.
KDE notes
TODO: There are settings that can be used in KDE to check for accelerator
conflicts. Not sure if any testing is possible in Gnome, OpenOffice or
Mozilla.
OpenOffice notes
OpenOffice.org seems to have a system that will automatically determine missing accelerator
keys. What would work best with this system is to mark the accelerators that you would
like to remain static and allow the others to be automatically determined. So keep "File",
"Edit", "View" accelerators constant but allow all others to be determined at runtime.