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

Multi-Language Add-In for Visual Studio


Localize accelerators

Hi,

I have the need to create a localized application that uses accelerators that change depending on the language of the application, as the property ShortcutKeys of ToolStripMenuItem. However, Multi-Language Add-In only works with strings. What I can do to fix this?

> Hi,
>
> I have the need to create a localized application that uses accelerators that change depending on the language of the application, as the property ShortcutKeys of ToolStripMenuItem. However, Multi-Language Add-In only works with strings. What I can do to fix this?

Germany

Hi,

as you have realized, the Add-In only supports strings.

What you can do, is to open the designer window in a specific language, and edit the ShortcutKeys by hand. The forms designer will then save any modifications to the localized .resx file. The Add-In should not modify these values when it writes strings to the .resx files.

If you have the Add-In open, you can open a form in the designer window and switch language with the combo box on the Add-In's toolbar.

If you do not have the Add-In open, you can change the language by setting the Language property of the form (assuming Localizable=True).

I always reset the language to default before closing the forms designer. (Otherwise it will open up in the selected language the next time you open the form, which I personally don't want.)

I will think about whether I can provide direct support for the ShortcutKeys in the Add-In, but I'm reticent to do it.

There are lots of different property types which can actually be localized, for example image properties. The Add-In would be a better product if it had support for all possible localizable properties, whatever the data type. If I did this, I would want to have custom editors in the grid. I would have to think about how to store the localized properties. I probably wouldn't be able to export all data types to an Excel file. In fact, I see all kinds of difficulties.

However, shortcut keys might be a special case, because they often related to the menu text.

How do you select the shortcut keys? Are the based on a letter in menu command (e.g. ALT-F for File). Would it be possible for the Add-In to generate this kind of shortcut algorithmically?

Phil


Hi,

Thank you for your response. I know the difficult that may be doing all the things you say. However, the shorcut keys are normally saved in the resource files as strings like "Ctrl+G", "Alf+F", etc., then, a initial approximation would be edit the localized shorcut in a normal textbox, like the other strings (with some type of validation when the textbox loses focus), and save directly to the resource file.