Localizable attribute

M

Michael Brown

Hi there,

After applying the "Localizable" attribute to my form using the (form)
properties window in VS, I was expecting to see "[Localizable(true)]"
preceding my form's class in code (added automatically by the IDE). I don't
however. Can someone point out where this info is stored. Thanks.
 
M

Michael Brown

After applying the "Localizable" attribute to my form using the (form)
properties window in VS, I was expecting to see "[Localizable(true)]"
preceding my form's class in code (added automatically by the IDE). I
don't however. Can someone point out where this info is stored. Thanks.

Ok, after reviewing the situation further am I to understand that setting
this "property" in the form's property window simply causes the IDE to
update the form's "InitializeComponent()" method so that all properties
already marked with the "Localizable" attribute (in all child controls on
the form) are now read from the resource file instead of being hardcoded?
IOW, there really is no "Localizable" property or attribute for the form
itself. Setting this "property" in the form's property window just toggles
all "Localizable" controls on the form (either hardcoding them in
""InitializeComponent()" or reading them from the resource files). Is this
correct? Thanks.
 
J

John J. Hughes II

If I understand correctly you are sent localizable from the form properties.
This changes all the form properties to be pulled from a default resource
file and also allows you to add additional locations with additional
resource files. The second "[Localizable(true)]" is used before a property
to have its value saved when changed to the local setting file.

If you open formname.designer.cs

Localizable = false
this.menuPrintPreview.Text = "Print Pre&view";
Localizable = true
resources.ApplyResources(this.menuPrintPreview, "menuPrintPreview");

Regards,
John
 
M

Michael Brown

John J. Hughes II said:
If I understand correctly you are sent localizable from the form
properties. This changes all the form properties to be pulled from a
default resource file and also allows you to add additional locations with
additional resource files. The second "[Localizable(true)]" is used
before a property to have its value saved when changed to the local
setting file.

If you open formname.designer.cs

Localizable = false
this.menuPrintPreview.Text = "Print Pre&view";
Localizable = true
resources.ApplyResources(this.menuPrintPreview, "menuPrintPreview");

Regards,
John

Ok, thanks. I'm still experimenting to come to grips with it all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top