Ejemplo n.º 1
0
        private void NewLocale()
        {
            var dialog = new NewLocaleDialog();

            dialog.ShowDialog();

            if (dialog.Result == DialogResult.Cancel)
            {
                return;
            }

            var newLocale = new Locale(dialog.LocaleKey);

            newLocale.ParentLocale = _localeManager.DefaultLocale;
            newLocale.Name         = dialog.LocaleName;

            var newFolder = Path.Combine(_folder, dialog.LocaleKey);

            if (!Directory.Exists(newFolder))
            {
                Directory.CreateDirectory(newFolder);
            }

            newLocale.Save(Path.Combine(newFolder, _localeManager.PropertiesXml));

            ChangeLocale(newLocale);
        }
Ejemplo n.º 2
0
        private void NewLocale()
        {
            var dialog = new NewLocaleDialog();
            dialog.ShowDialog();

            if (dialog.Result == DialogResult.Cancel)
                return;

            var newLocale = new Locale(dialog.LocaleKey);
            newLocale.ParentLocale = _localeManager.DefaultLocale;
            newLocale.Name = dialog.LocaleName;

            var newFolder = Path.Combine(_folder, dialog.LocaleKey);
            if (!Directory.Exists(newFolder))
                Directory.CreateDirectory(newFolder);

            newLocale.Save(Path.Combine(newFolder, _localeManager.PropertiesXml));

            ChangeLocale(newLocale);
        }