Wisej is fully localizable using .NET and Visual Studio standard localization features.
All the top level controls in Wisej support UI localization.
To enable the localization features for a Form, Page, UserControl, or Desktop component, when in design mode set the Localizable property to true. After the localization feature is enabled, you can switch the language in the designer.
To switch the language, use the Language drop down property to select the language to localize
UI localization lets you change a large number of properties in relation to a language switch. The most common are the Size, Location, Text, Colors, and Images.
Wisej also supports the full localization of system resources, such as the buttons in the MessageBox and the labels (month and day names) in the calendar controls, as well as all the standard numeric, percentage and currency formatting and parsing.
- Numeric, Percentage, Date, and Currency FormatsYou don't have to do anything, it's all handled automatically for just about any language in the world.
- Date Labels: Months and Day NamesAlso in this case you don't have to do anything, it's all handled automatically for just about any language in the world.
- System ResourcesAt the time, all Wisej system resources are localized in English, German, French, Italian, Turkish, Spanish and Portuguese. You have to provide the localization in any other language. All you need to do is to create a Resources-[LANG].resx file either in the root folder of the project or in the /Resources folder and add the labels to localize. See How to: Create a Localized Version of a Resource File.LabelDescriptionDefault Value$OkOK Button in the MessageBox or other system dialogs.OK$CancelCancel Button in the MessageBox or other system dialogs.Cancel$YesYes Button in the MessageBox or other system dialogs.Yes$NoNo Button in the MessageBox or other system dialogs.No$RetryRetry Button in the MessageBox or other system dialogs.Retry$IgnoreIgnore Button in the MessageBox or other system dialogs.Ignore$AbortAbort Button in the MessageBox or other system dialogs.Abort$Next yearTooltip for the next-year navigation button in the MonthCalendar and DateTimePicker Date Selector.Next Year$Next monthTooltip for the next-month navigation button in the MonthCalendar and DateTimePicker Date Selector.Next Month$Last yearTooltip for the last-year navigation button in the MonthCalendar and DateTimePicker Date Selector.Last Year$Last monthTooltip for the last-month navigation button in the MonthCalendar and DateTimePicker Date Selector.Last Month$OfflineText shown in the offline toast when the system detects a loss of connectivity.Offline
In addition to formatting, parsing, system labels and controls, you will most likely need to localize other resources (strings, images, ...) used in the code of your application.
You may create as many resource files (.resx) as you like and localize them using the same approach explained above and here: How to: Create a Localized Version of a Resource File.
In your code you can simply create an instance of the ResourceManager Class and use it to retrieve the localized values. Wisej takes care of switching the culture of the thread that is managing the client request.
var RS = new ResourceManager("Localization.Resources", this.GetType().Assembly);
var title = RS.GetString("Title");
Dim RS as ResourceManager = new ResourceManager("Localization.Resources", Me.GetType().Assembly)
Dim title as String = RS.GetString("Title")
Wisej automatically recognizes the browser's language and switches all the application and system resources to use the browser's language.
You may force the application (user session) to run using a specific language setting the culture property in Default.json. The default value is "auto". See Configuration for more information about setting the application's culture.
You may also always force the user session to use a specific language in two alternative ways:
- Set the culture by assigning Application.CurrentCulture property.
When the current culture changes from the original culture loaded when the session was started, Wisej fires the Application.CultureChanged event.
Controls that have been localized using the designer are updated only when they are created. There is no built-in mechanism to change controls that have already been created. If you want to be able to alter controls that have been created with a different culture you have to either re-create the container and invoke InitializeControl again; or write custom code that applies the resource again.