An accelerator key is a key on your keyboard that you can press to quickly access a menu or function. It is also sometimes called a hot key, access key or mnemonic.
If you look at the menu bar on any application you will see that the first
letter of each entry in underlined. Notice that F̲ile, E̲dit and V̲iew each have
the first letter underlined. To quickly open the File menu press
You will notice that most of the menu entries also have accelerator keys, to
access O̲pen simply type
O after typing
An accelerator marker is the special character we use to mark accelerator keys when we translate.
In translations accelerator keys are shown by various characters:
|Application||Marker||Name||Source Text Example||Displays As||Note|
|KDE||&||ampersand||Save &As...||Save A̲s...|
|GNOME||_||underscore||Save _As...||Save A̲s...|
|OpenOffice.org||~||tilde||Save ~As...||Save A̲s...|
|Mozilla||&||ampersand||Save &As...||Save A̲s...||Using moz2po|
|Windows Windows RC files||&||ampersand||Save &As...||Save A̲s...|
In all of the above examples pressing
A would take you to the Save As
What happens if you want to use the & character without making it an accelerator? In this case the accelerator is usually escaped by using && (for KDE) or & (for Mozilla). E.g. “Mail && News” or “Mail & News”. As a translator you would be free to drop the & and use the equivalent of “and” in your language.
How do you select an accelerator key for your languages? Keep these principles in mind:
We usually follow these simple rules.
If we have two accelerator keys using the same letter then we say that we have a clash. Assume that the following list are the top three entries in a menu:
You will notice that all the accelerators use the
A key – this is a
clash. Fortunately most applications will cycle through the options as you
press A repeatedly. But what would happen if the 3rd item appeared first? (The
third item uses the ellipses (...) to indicate that a dialogue box will open.
This if this appeared first you would never be able to access the other items.
Here is a better choice of accelerators for the same menu:
We now use
c – there are no conflicts.
|X̲ Axis...||K̲hona ya X...||Khona ya X̲...||This accelerator appears nicely on the letter X in the English. The translator slavishly followed the first rule of keeping the accelerator in the same position. Yet the good version, which follows rule 2, is much better as it keeps the same letter and it also works for the next string which is //”__Y__ Axis...”//|
|8̲00x600 pixels||d̲ikarolwana tse 800x600||dikarolwana tse 8̲00x600||This follows the previous example. The translator has continued to use the first letter of the translation even though the number work well in the translation so there was no need to change the accelerator. It also work with the surrounding translations that cover 1024x768, etc. With the option chosen by the translator all of these translations would use the __d__ as the accelerator which wouldn’t work.|
|URL for P̲erl scripts||URL bakeng sa m̲aqephe a Perl||URL bakeng sa maqephe a P̲erl||You will notice that Perl is untranslated this is because in Sotho it was decided not to translate the names of computer languages, they’re really like brand names. So here the accelerator appears in English associated with Perl. Perl appears in the translation and therefore we could simply have transferred it without any worry about accelerator conflicts.|
|An ~example||Bad~translation||Good ~translation||This example shows a common error of leaving out a space between words. Because the accelerator sometimes in your mind looks like a space its easy to forget to place the space between words in the translation.|
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 <original> <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.
What happens if you select the same accelerator key for two different components? How do you check this?
Firstly, it is not a big problem. Once the application is fully translated these conflicts should sort themselves out over time.
FIXME 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.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.