Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            #region Binding button to the localiztion system
            // Creating GUI content.
            var content = new GUIContent()
            {
                // Adding the title that will displayed in case if localization key not found via loaded.
                DefaultTitle = "Native title",

                // Adding the key that will be looking into the loaded dictionaries.
                TitleLocalizationResourseKey = "localizedLabelCustomKey"
            };

            // Binding the content to the button's label.
            content.BindToLabel(localizedButton);
            #endregion

            #region Loading localization dictionaries
            LocalizationHandler.LoadDictionaries(
                // Getting local lang folder from the source project.
                langDictsPath,
                // Request english localization as prior.
                new CultureInfo("en-US"),
                // Request russian localization as secondary in case if english not found.
                new CultureInfo("ru-RU"));
            #endregion

            // Subscribing on the event of the language change.
            langPanel.ValueChanged += LangPanel_ValueChanged;
        }