Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Change the language for Button VB.Net

magicdl96
Advocate

Change the language for Button VB.Net

magicdl96
Advocate
Advocate

hello everybody,

I built the Add-in whose buttons are in the English language. And I want to create a new Button to change the language in my Add-Ins.

Anyone have any ideas to help me?

Thank you so much.

0 Likes
Reply
478 Views
6 Replies
Replies (6)

robertast
Collaborator
Collaborator

@magicdl96 

Isn't it easier to rewrite Add-in in the right language?

0 Likes

magicdl96
Advocate
Advocate

I want to write a multilingual Add-In. And I can't rewrite every language. 

0 Likes

HideoYamada
Advisor
Advisor

Hi,

 

Are you using WinForms? Or WPF?

If you use WinForms, "Language" property of the base form changes the language.

 

Default.pngJapanese.png

 

It's an important that the text should be written in English when "Language" property is "(Default)".

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes

HideoYamada
Advisor
Advisor

Language will be selected automatically and it is depending on Inventor's language. (Not Windows's)

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes

magicdl96
Advocate
Advocate

Yes. I know. But i want change language of button on ribbon.

magicdl96_0-1593412940389.png

0 Likes

HideoYamada
Advisor
Advisor

Hi,

 

Create a string in Resources.resx and Resouces.<language>.resx and replace the hard-coded texts in your code to "Properties.Resources.<string name in resources.resx>".

 

// This code is in C#.

// Change the code from:
// var CommandName = "My command name";
// To:
var CommandName = Properties.Resouces.MyCommandName;

// "MyCommandName" must exist in Resouces.resx.

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes