2

How can i make my app in a different language, so people can select another language,

I need to translate some buttons, textboxes and labels. Is there a easy way for this?

2 Answers 2

10

You need to externalize your string resources. If you wish to localize only form elements, then you can do this directly in WinForms designer within Visual Studio.

First, in the property grid in form designer, set form's Localizable property to true. Then, after setting Language property to desired target languages, set Text values for your labels and textboxes.

VS will extract .languagecode.resx files storing the localized values for you. The localization then occurs automatically at runtime based on user's locale.

If you want to override the setting based on user's preference, set Thread.CurrentThread.CurrentUICulture and CurrentCulture to a CultureInfo instance describing target culture before first form initialization, based on desired language, e.g.

string targetCulture = "de";
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(targetCulture);

Store the target culture value in application Settings or anywhere where you see fit.

Learn more about localization in .NET here

0
2

It's not easy as in "it's very little work", but it's relatively easy in the "Hey, that's not too hard to understand" way.

Basically, you have to use string resources for different cultures, rather than typing the text into the tags.

I found a fairly straightforward example for you here:

http://www.c-sharpcorner.com/uploadfile/ankithakur/globalization_localization_in_dotnet_csharp07032006023510am/globalization_localization_in_dotnet_csharp.aspx

Of course, if you're just looking for a quick and dirty means of translating stuff for your own use, or to translate text items to go into your resource files, you can always use Babel Fish:

http://babelfish.yahoo.com/

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.