private IEnumerable <string> GetSharedCultures() { var sourceCultures = XmlTypeReader.ReadAs <AvailableCultures>( Path.Combine(ApplicationModel.TranslationDirectory, "AvailableCultures.xml")); var targetCultures = XmlTypeReader.ReadAs <AvailableCultures>( Path.Combine(TargetDirectory, "AvailableCultures.xml") ); return(sourceCultures.Cultures.Select(c => c.Lang.ToUpper()) .Union(targetCultures.Cultures.Select(c => c.Lang.ToUpper())).OrderBy(c => c)); }
public override void Execute(object parameter) { var translationModel = parameter as TranslationResources; var defaultDirectory = Path.Combine(translationModel.ApplicationModel.TranslationDirectory, "Overrides"); if (!Directory.Exists(defaultDirectory)) { Directory.CreateDirectory(defaultDirectory); } using (var sfd = new SaveFileDialog()) { sfd.InitialDirectory = Path.Combine(translationModel.ApplicationModel.TranslationDirectory, "Overrides"); var result = sfd.ShowDialog(); if (result == DialogResult.OK) { var filename = sfd.FileName; XmlTypeReader.SaveTo(filename, new TranslationFile()); translationModel.TranslationFiles.Add(filename); } } }