Bazaar

Bazaar

 




Wiki Tools

  • Find Page
  • Recent Changes
  • Page History
  • Attachments

Dealing with special character "&" in translations.

This page summarize of a discussion in Bazaar Developers mailing list in a thread entitled "Translations of bzr-explorer". The thread started about 2009-10-15. The discussion was about the problems of dealing with this special character in several languages.

What does the special character & mean?

One correspondent (Philippe) writes:

In Windows at least, when the right option is checked[1] (it was by default before XP), the character after "&" is underlined. If this option isn't activated, the underline appears only when pressing Alt. The idea is that if you hit Alt+character, eg. Alt+Q when you see _Q_uit, the corresponding item is activated: the menu is selected, the field (text, combo box) associated to the label gains the focus, the button is pressed, the checkbox is toggled... In short, the point is to make visible (and enable) keyboard accelerators...

[1] Display properties > Appearance tab > Effects button > uncheck option looking like: Mask letters underlined for keyboard navigation until I press the Alt key -- well hidden, no?

They are often overlooked by developers, but I find them useful so I carefully add them.

In general, I try and keep the same letter (character) as the English one, if I can. But one should also avoid conflicts, ie. identical shortcuts in the same menu or dialogue. For consistency, it is better to look at existing applications to take a common shortcut. For example, in Windows, look at WordPad, Notepad, Paint menus. Although they are not necessarily consistent... But that's a start. That's also why I named top-level menus like I did (Fichier, Affichage, Options...).

We can also see sentences like: "Delete file %s?" The %s will be replaced by the filename (or other parameters elsewhere), so must be kept as is. The same for %d (numerical value). Also saw "Repositories found below this repository: %(rows)d". Not sure of the exact meaning of it, but %(rows)d is to be kept as is.

Different needs in different languages

The difficulty of handling the special "&" character varies between languages. Another correspondent (Algis) writes about it as follows:

In Lithuanian, which is an old Indo European language, the opportunities are negligible to keep the same letter after & as in the original. I recall one E&xit in the original. The letter x is not used in Lithuanian, though available on the standard keyboards, principally for words from other languages. I think it would be better in such circumstances to translate to something like this:

E&xit
Išvykti - (&x)

"Išvykti" being the verb "to exit" in Lithuanian. It would be inefficient to "re-invent the wheel" with a new set of letters that call a certain action for every language. Avoiding duplicate accelerators would also depend on the context, as already mentioned.

It is recognised that the differences between the application of "&" is different in different languages. The translators are free to choose any character for the accelerator. There are two reasonable strategies for that choice:

First, choose the same character as in English since that is the most commonly implemented language. This probably is only a reasonable heuristic in multilingual cultures (Swiss, Belgian, Quebec) where people are likely to be switching  keyboard layouts.

We should add to that a list of the Baltic languages - Finish (Linus Torvald's original country), Estonian (which is very similar to Finish), Latvian, Lithuanian. Probably also the Scandinavian languages Norwegian, Swedish and other Germanic languages might also require switching of keyboard layouts. Most likely it would apply also to Slavic languages, Polish, Ukrainian, Russian, Croatian etc. All would require switching keyboard setup, if they also write in English.

Second, choose the same character as in other applications where that function is defined in your language. Note how this applies to
"E&xit" vs. "&Quitter" in the French example.

How about other languages?

In the two main choices presented above, the main points related to English - French translation, with a mention of other Francophone languages. It is a good deal more complicated, actually. Even the example of "Belgian language" is open to miss-interpretation, as there are at least two main languages in Belgium - French and Flemish (there also is a substantial German speaking minority). But the switching of keyboards is much more widely required. In reality, for a great majority of Asian languages, the change of keyboard becomes essential. Many cultures use different scripts, yet the users may wish to to use English language frequently, so again requiring switching of the keyboard layout.

What do you think? Your opinion is important. Please use this wiki page to let others know your opinion.