Exemplo n.º 1
0
 private void AddLocale()
 {
     SaveChanges(true);
     try
     {
         SelectLocaleForm form = new SelectLocaleForm();
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             string locale = form.SelectedLocale;
             string path   = Path.Combine(this.DataDirectory, locale);
             if (!Directory.Exists(path))
             {
                 Directory.CreateDirectory(path);
             }
             string sourceFile = Path.Combine(this.DataDirectory, @"en-US\Resources.xml");
             string destFile   = Path.Combine(path, "Resources.xml");
             File.Copy(sourceFile, destFile, true);
             LoadLocales();
             SetCurrentLocale(locale);
         }
     }
     catch (Exception ex)
     {
         ShowError(ex);
     }
 }
Exemplo n.º 2
0
		private void AddLocale()
		{
			SaveChanges(true);
			try
			{
				SelectLocaleForm form = new SelectLocaleForm();
				if (form.ShowDialog(this) == DialogResult.OK)
				{
					string locale = form.SelectedLocale;
					string path = Path.Combine(this.DataDirectory, locale);
					if (!Directory.Exists(path))
					{
						Directory.CreateDirectory(path);
					}
					string sourceFile = Path.Combine(this.DataDirectory, @"en-US\Resources.xml");
					string destFile = Path.Combine(path, "Resources.xml");
					File.Copy(sourceFile, destFile, true);
					LoadLocales();
					SetCurrentLocale(locale);
				}
			}
			catch (Exception ex)
			{
				ShowError(ex);
			}
		}