c# - Cannot localize (translate) a custom control in .NETCF 2.0 -


i translating compact framework 2.0 windows form in visual studio 2005. that, change language of form german (the target language) , edit/resize controls on form. creates resources.de.resx file containing translated strings expected.

however, there custom control on form, has property called grouptext, must translated. however, form designer refuses use resource files property. whenever change property in property editor, gets changed languages. checked resx files - not contain grouptext property, , designer generated code not use resx file property.

is there way enable resx-based, visual studio supported localization custom controls well?

edit:

as addition accepted answer, here's have resx files custom controls work.

each property should go resx file must have localizable attribute set true. now, cf not support attribute via usual bracket syntax. cannot write [localizable=true] in cs source file. have create separate file called designtimeattributes.xmta in project , add following:

<?xml version="1.0" encoding="utf-16"?> <classes xmlns="http://schemas.microsoft.com/visualstudio/2004/03/smartdevices/xmta.xsd"> <class name="mycontrol">   <property name="myproperty">     <localizable>true</localizable>   </property> </class> 

once rebuild assembly containing control, visual studio put property values resx files.

custom controls think quite obvious reasons not localizable default, author of such control has take care of that. custom controls have boolean localizable property, controls whether control writes messages resource file assume not case here.

if text want translate accessible via property or constructor, can create own *.resx file , assign text during creation. if not, afraid you're out of luck.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -