How to translate the property item name of the control in the properties window?
-
How to translate the property of the control in the properties window? For example,there is a Button on the winForm,then many properties is listed in the properties windows,such as Text、BackColor,now I want to translate the name of the property from english into other languange: for instance: English Chinese Text 文本 BackColor 背面颜色 Thanks all in advance!
-
How to translate the property of the control in the properties window? For example,there is a Button on the winForm,then many properties is listed in the properties windows,such as Text、BackColor,now I want to translate the name of the property from english into other languange: for instance: English Chinese Text 文本 BackColor 背面颜色 Thanks all in advance!
-
Donwload the .NET languagepack[^] of your choice and install it. It doesn't only translate error-messages, but also properties, if I'm not mistaken. You cannot translate the texts by yourself, since there is no interface.
Thank Eddy for your answer. I remember my colleague I have achieved this funtion in his program,not handling by the system languagepack,He can change the Text property of the button with any name.
-
Thank Eddy for your answer. I remember my colleague I have achieved this funtion in his program,not handling by the system languagepack,He can change the Text property of the button with any name.
The language-pack does it automatically, and the translations are embedded deep in the .NET runtime. It's a low-impact solution to your question, and I suggest you take a look at it before experimenting with sourcecode. BTW, my Visual Studio IDE @ work uses these Dutch language-packs, and it's bloody annoying to search for something simple like "ForeColor". Not only is the sort-order different (Voorgrondkleur), but it's in a category with a different name. It gets worse when you're facing a localized version of an error - and you need to search the English-based MSDN for the same error.. It doesn't increase the productivity, it just causes more bugs. Within the computer, everything should remain in a single language. That has nothing to do with the language that the end-user sees. It's just not possible to teach a computer all the localized versions of a boolean.
mctramp168 wrote:
I remember my colleague I have achieved this funtion in his program,not handling by the system languagepack,He can change the Text property of the button with any name.
Phone your collegue, ask how he did it :) You could also redefine the property-names, as shown in the example below;
/// <summary> /// This is the original property. We want to 'rename' these in code as well as /// in the property-editor. First, we'll hide the current property as much /// as reasonable: /// </summary> \[Browsable(false)\] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } /// <summary> /// This is our 'translated' version of the "ForeColor". It gets dumped in the same /// category as before, but you could also translate that string. /// /// If you do, a new category will be created automatically, and the property will /// be visible under that new category-name. /// </summary> \[Browsable(true), Category("Appearance")\] public System.Drawing.Color VeurgrondKleur { get { return this.ForeColor; } set { this.ForeColor = value; } }
This will hide the "ForeColor" from the property-editor in Vi
-
The language-pack does it automatically, and the translations are embedded deep in the .NET runtime. It's a low-impact solution to your question, and I suggest you take a look at it before experimenting with sourcecode. BTW, my Visual Studio IDE @ work uses these Dutch language-packs, and it's bloody annoying to search for something simple like "ForeColor". Not only is the sort-order different (Voorgrondkleur), but it's in a category with a different name. It gets worse when you're facing a localized version of an error - and you need to search the English-based MSDN for the same error.. It doesn't increase the productivity, it just causes more bugs. Within the computer, everything should remain in a single language. That has nothing to do with the language that the end-user sees. It's just not possible to teach a computer all the localized versions of a boolean.
mctramp168 wrote:
I remember my colleague I have achieved this funtion in his program,not handling by the system languagepack,He can change the Text property of the button with any name.
Phone your collegue, ask how he did it :) You could also redefine the property-names, as shown in the example below;
/// <summary> /// This is the original property. We want to 'rename' these in code as well as /// in the property-editor. First, we'll hide the current property as much /// as reasonable: /// </summary> \[Browsable(false)\] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } /// <summary> /// This is our 'translated' version of the "ForeColor". It gets dumped in the same /// category as before, but you could also translate that string. /// /// If you do, a new category will be created automatically, and the property will /// be visible under that new category-name. /// </summary> \[Browsable(true), Category("Appearance")\] public System.Drawing.Color VeurgrondKleur { get { return this.ForeColor; } set { this.ForeColor = value; } }
This will hide the "ForeColor" from the property-editor in Vi
Thank Eddy for your zealous help. I know your above handleing method,if each property is handled like that, It needs a lot of time, I saw a set software, it can let non-programmer user to design a winform after you teach them simply, the winform's property is translated by the programmer, then the non-programmer can very easy to learn to design simple winform. I only want to know this skill of translating the property of the control. I try to ask my past colleague. Thanks !