To fully localize a NOV based application, you should follow these principles:
Localizing String Literals |
Copy Code
|
---|---|
string localizedString = NLoc.Get("Cancel"); |
Localizing Enums |
Copy Code
|
---|---|
#region Localizable Enums /// <summary> /// Enumerates the supported command UI types. /// </summary> public enum ENCommandUIType { /// <summary> /// Ribbon based command UI. /// </summary> Ribbon, /// <summary> /// Command bar (menus and toolbars) based command UI. /// </summary> CommandBars } #endregion |
The following example demonstrates how to localize a WinForms application to German:
Localizing a WinForms application |
Copy Code
|
---|---|
using System; using System.IO; using System.Windows.Forms; using Nevron.Nov; using Nevron.Nov.Globalization; using Nevron.Nov.Windows.Forms; namespace WindowsFormsApplication1 { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Localize the application string cultureName = "de-DE"; NApplication.CurrentUICulture = NCultureInfo.GetCultureInfo(cultureName); using (Stream stream = File.OpenRead(@"C:\ProgarmFiles\MyApp\Languages\NovDictionary_de-DE.tmx")) { NApplication.LocalizeFromStream(stream); } // Apply license for redistribution here. You can skip this code when evaluating NOV. NLicenseManager.Instance.SetLicense(new NLicense("LICENSE KEY")); // Install NOV NModule[] modules = new NModule[] { // TODO: Create modules here }; NNovApplicationInstaller.Install(modules); // Run the main form of the application Application.Run(new Form1()); } } } |