Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


Ampersands in translations

I have noticed that some translations, using the global database have an ampersand (&) at the beginning of the text when the ampersand does not seem to appear in the original text.

For Example:
English (original) French (fr)
Data & Données
Indicators & Indicateurs
&Reference & Référence

I am not sure why for the first two translations an ampersand has been added.

For the third translation (&Reference) the ampersand denotes a shortcut key, is it possible to stop Multi-Langauge from adding a space in the translated text>

Germany

This behaviour is stupid. I have modified it in version 4.7x.0132, which I have just uploaded.

In Windows Forms applications and in VB6 applications the & character is used to prefix a so called accelerator key. Usually it can be used in combination with the Alt key a shortcut for the command. You probably know that anyway. (It might be a basic function of Windows itself. I'm not sure at what level it is implemented).

I originally implemented the global database in my Add-In for VB6. It was a design decision at the time to handle the & character as a special case. The & character is actually removed from the string, but the position of the character is stored in the database with the string. This means it will not get in the way when I search for a text, but it can be reinserted when I use the text.

In the new version, the Add-In will only insert the & character into the translation if there was an & character in the original text. This means that it might translate "&File" with "&Fichier", but "File" with "Fichier".

To be honest, I have often thought that it was a bad decision to have any handling for the & character at all. The Add-In could simply have removed them before storing a text in the global database.

A different way of handling accelerator keys would be to insert them automatically, with an algorithm to select a different character in each menu command (or button, check box or radio button). In fact, this would be a neat little tool anyway.

Phil


Thanks for that Phil,

I noticed as I manually changed the translations that there were some occurances of "Indicators" and some of "&Indicators" so I guess that is why the transaltion I noticed had the ampersand where the original text I was looking at didn't

We have just started using the Add-In against a solution with 29 projects in it, I don't know what we would have done without the tool it is very good!


Martin