ahmd0
ahmd0

Reputation: 17313

How to localize a Windows.Forms .NET application?

I created a test .NET application that I need to learn ways to localize or translate. Say, I created my form derived from Windows.Forms.Form, that in turn created a .resx file. I understand that the Visual Studio's designer allows to change text for UI elements, but what if I want to add my own resource string that is used in the code? I tried adding it manually to the .resx file, but I got this warning:

enter image description here

And also what's up with that other stuff in the .resx file, that I marked in green in my screenshot above? You see the way I was picturing the process of translation was by sending the .resx file to the person doing the translation, but with all that "junk" in the .resx file it will be quite confusing for a person that is not familiar with programming.

So can someone give their insight on these points?

Upvotes: 0

Views: 583

Answers (1)

MichaC
MichaC

Reputation: 13410

If you want to go with resource files, simply add another resource file to your project by add new item > resource file...

This will be available for you strongly typed via ResourceFileName.ResourceName

The attached resources for your forms are generated by visual studio and it seems you should not really change them for that reason (code generation...).

Don't know what exactly those marked things are but seems to something you have in your form window? Checkbox1 etc... should actually match with the elements within your form.

Upvotes: 1

Related Questions