Localization is the process of providing controls in different cultures, allowing end-users to set their own culture. In the globalized world, you cannot just ship software with only one language; you have to be in a position to provide an application with localized culture support. In Essential Studio® Volume 3, Syncfusion Silverlight Tools controls ship with complete support for localization, which makes your life easier by being able to localize your entire application.
Here we will discuss how you can enable localized support for your application with Syncfusion controls.
Here are the primary things to do for localizing Syncfusion Silverlight controls in your application:
To localize Syncfusion Silverlight controls, you need to create resource files with the proper naming convention for each culture. The following steps need to be done when localizing strings for your culture.
In step two, AssemblyName is the Syncfusion Silverlight control assembly name and CultureName is the culture code of the resource you want to show in the UI. If your conversion is only for an invariant culture, the .resx file does not need to contain a culture suffix.
For example …
3. Apply the localized content in the Syncfusion.Tools.Silverlight.fr-FR.resx file for each string variable, as given below, for localizing the Ribbon Control Customization dialog and context menu.
Name | Value |
Add | Ajouter |
Cancel | Annuler |
ChooseOtherCommandsFrom | Choisir les commandes d’autres: |
CustomizeQuickAccessToolbar | Personnaliser la barre d’outils Accès rapide … |
DefaultRibbonBarCaption | Ruban Bar |
DefaultRibbonButtonCaption | Ruban Button |
DefaultRibbonTabCaption | Ruban Tab |
DefaultRibbonTitle | Ma demande |
MinimizeRibbon | Réduire ruban |
MoreCommands | Commandes en savoir plus … |
OK | OK |
QATPopupHeader | Personnaliser la barre d’outils Accès rapide |
QATShowAbove | Voir la barre d’outils accès rapide au-dessus du ruban |
QATShowBelow | Voir la barre d’outils accès rapide sous le ruban |
Remove | Supprimer |
Reset | Remise |
Note: This table shows the necessary string variable names that are needed only for this post. You may need to apply many other string variables based on the control feature. Complete information will be published with the 2010 Volume 3 documentation.
It’s very important to add supported cultures in the sample application project before running the application.
For example: <SupportedCultures>fr-FR</SupportedCultures>
4. Save the project and reload it by right-clicking on the SampleProjectName.csproj. Then choose Reload SampleProjectName.csproj.
By default, the current culture will be “en-US,” which you can check from System.Threading.Thread.CurrentThread.CurrentUICulture.
Now you can change CurrentUICulture as you want, as seen below.
Here, CurentUICulture should be set before IntializeComponent in your StartUp page (MainPage.xaml.cs) or you can set it in App.xaml.cs in the Application_Startup event.
public MainPage() { System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR"); InitializeComponent(); }
Or in the App.xaml.cs file …
private void Application_Startup(object sender, StartupEventArgs e) { System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR"); this.RootVisual = new MainPage(); }
Ribbon Control for Invariant Culture
French Culture Assigned as Current UI Culture for Ribbon Control
Customization Dialog for Invariant Culture
French Culture Assigned as Current UI Culture for Customization Dialog
The same pattern is applicable to all other Syncfusion Tools Silverlight controls, and other packages will have this support added on or before the 2010 Volume 4 release. We welcome your valuable feedback about this feature to enhance support for Volume 3, which is scheduled for mid July.