Hi,
If your locale works on Firefox (desktop, Android) in Pootle, please
keep reading this message. After checking several locales in the past
weeks, it's clear that there's a lot of confusion about this subject.
*What are accesskeys?*
Accesskeys, not to be confused with shortcuts (or commandkeys), are used
to access a UI element from the keyboard. Example: if File menu has an
accesskey F, and the Open menu has O, I can press ALT+F to access the
menu, and then O to open a file.
If the label is File, and the accesskey is F, it will be displayed as
"_F_ile" on Windows and Linux, with an underscored F. If the accesskey
was "O", so a character not available in the original label, it will be
displayed underlined between parenthesis: "File (_O_)".
*How accesskeys work in Pootle*
In the original localization file, label and accesskey are two separate
strings, for example:
<!ENTITY fileMenu.label "File">
<!ENTITY fileMenu.accesskey "F">
Pootle tries to help localizers by showing a single string, with the
accesskey preceded by a & (ampersand) character: &File. It then splits
the label during export in its original format (two strings).
*How to deal with accesskeys*
The first thing you need to decide is if you want to have localized
accesskeys: for example, if most users for your locale use a keyboard
with a different layout (English), it might make sense to keep the
English original accesskey instead of using a letter available in your
localization.
If you want to localize the accesskey, simply *put the & before the
letter you want to use*. For example, in ga-IE the string is stored as
&Comhad (label: Comhad, accesskey: C).
Export result in the repository:
<!ENTITY fileMenu.label "Comhad">
<!ENTITY fileMenu.accesskey "C">
In Firefox it will be displayed as "_C_omhad".
If you want to fallback to English, just *drop the &, it will fall back
to English automatically*. For example, ml: the string is stored in
Pootle as ഫയല് (label: ഫയല്, accesskey: none, fallback to English).
Export result in the repository:
<!ENTITY fileMenu.label "ഫയല്">
<!ENTITY fileMenu.accesskey "F">
In Firefox it will be displayed as "ഫയല് (_F_)".
Both are acceptable choices.
On the other hand, *all the following translations are incorrect*:
* Keep the string in English: &File. You need to localize the string
as if & was not there, so translate "File" and then determine what
to do with the accesskey.
* Keep somehow the accesskey in the label (I'll use ga-IE as an
example): "Comhad &F", "Comhad (F)", "Comhad F". For example, the
last case would be displayed as "Comhad _F_" in Firefox. This seems
to be the most common error.
* Keep the ampersand alone: "& Comhad", "Comhad &". This will result
as "Comhad &" in the export, with the & escaped, and displayed
as "Comhad & (_F_)" in Firefox.
*Variables are not accesskeys*
And then there's another error. Consider for example this string:
<!ENTITY firstrun_tabqueue_subtext_on "You can always turn this off in
&settings; under &pref_category_general;.">
Both &settings; and &pref_category_general; are *variables*,
placeholders, and *must not be translated*. Unlike labels with
accesskeys (&File), they end with a semicolon, and that's how you can
recognize them. Another common example used across Firefox is
&brandShortName;
All these variable errors are reported on the l10n dashboard
(
https://l10n.mozilla.org), so always keep an eye on it.
As usual, let me know if you have any questions.
Francesco