Nevron Open Vision Documentation
Localizing Applications

To fully localize a NOV based application, you should follow these principles:

  1. Encapsulate all string literals subject to localization in NLoc.Get() like this: 
    Localizing String Literals
    Copy Code
    string localizedString = NLoc.Get("Cancel");
    
  2. Place all enums that should be localized in a region called Localizable Enums, for example:
    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
    
  3. Download the Nevron Dictionary Editor from Nevron's website and use the Import button to import all localizable strings from your project or solution. Note that if you want to localize the strings used by the NOV components, too, you should start with opening a Nevron Open Vision dictionary and then import your application's localizable strings to it. After the strings to localize are imported, you should select a culture to localize to from the combo box in the Nevron Dictionary Editor's toolbar and start translating the strings.
  4. In your project load the localization dictionary in the entry point of the application, just after the code that installs the NOV framework.

The following example demonstrates how to localize a WinForms application to Russian:

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);

            // 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);

            // Localize the application
            string cultureName = "ru-RU";
            NApplication.CurrentUICulture = NCultureInfo.GetCultureInfo(cultureName);
            using (Stream stream = NFile.OpenRead(@"C:\ProgarmFiles\MyApp\Languages\Russian.xml"))
            {
                NLocalizationDictionary.Instance.LoadFromStream(stream);
            }

            // Run the main form of the application
            Application.Run(new Form1());
        }
    }
}
See Also
Send Feedback