0

I have a VS Solution in that my project contains something around 160 Forms. Now I want to get the Control's text property from all the forms.

Why I want to do is my application is in English Language. My client asked me to convert the whole software into other languages also. Now he wants me to provide him list of all menu and other controls in a Excel or XML sheet from where he will translate everything.

SO is there any mechanism available which can read all of my forms and its control and save text/caption of every item in a external file or may be in any medium.

Is it possible. Looking for fellow support. Regards.

ADD1:

Like I have a MDI form and its designer contains this.mnu_recycle.Text = "Recycle";

Likeways we have n number of .Text items. I just want a list of all of them.

Django Anonymous
  • 2,987
  • 16
  • 58
  • 106
  • 1
    Well there is nothing built in to do that. But you could code something. form.controls impelents IEnumerable, so you can loop through with foreach – Daniel Abou Chleih Sep 16 '13 at 05:16

1 Answers1

1

Create some code that creates an instance of each form then loops through all the controls getting the text and name of the control. Write the info (Form name, control name, control text) to a csv file or generate a resource file which can be translated. You can then write a small app to change the form code files to use resource files.

Programmatically creating a resource file http://msdn.microsoft.com/en-us/library/gg418542.aspx

Resource files will make your application be easier to translate to other languages take a look at these

C#: How to bind the text of a winforms button to a resource

What would be the easiest way to generate new localized resource files?

How to load C# winform strings from resource file without rebuild

Community
  • 1
  • 1
carbo18
  • 468
  • 3
  • 8