I am building an enterprise C#.net application, the requirement is there will be Arabic and English version both. 2 options are given from client, either to write English plus Arabic together for labels and descriptions or to place a combo box in start having English and Arabic to select and to proceed with that language. I want to save my time and want that i could just build an English version and Arabic must be auto translated.
Thanks in advance.
First of all, you do not need to select anything, it would be already selected if somebody set Arabic Locale in his/her Operating System. To detect what language is used (if you need this information, usually you don't) you would simply read
System.Globalization.CultureInfo.CurrentUICulture
property.However, in WinForms you could actually use built-in Localization support. To do that, you need to switch Form
Localizable
property to true. Assuming that you have Arabic strings provided, you would need to switch Form'sLanguage
property from (default) to Arabic after you complete you English layout and place the translations in appropriate places. That is the easiest way. You would also need to switch Form'sRightToLeft
property to Yes andRightToLeftLayout
to True while on Arabic.If you do that properly, you would see that form is mirrored. That's desired situation, do not panic.
The worse part is that you would occasionally need to display Message Boxes. The problem here is, that depending on what language type you are using, you actually would need to do it in a different way, for Arabic (and other RTL languages) require that RTLReading constant be used:
That's it on the high level...
you can use 2 resource files one in English and one in Arabic and when you select the language the application selects what resource file to use.