public List <ResourceDataBase> GetItemsNotExistingInCulture(VSCulture culture) { List <ResourceDataBase> notExisting = new List <ResourceDataBase>(); foreach (IResourceFile file in files) { foreach (ResourceDataBase data in file.Data.Values) { if (data.ResxFile.FileGroup.Files.ContainsKey(culture.Culture)) { IResourceFile culturedFile = data.ResxFile.FileGroup.Files[culture.Culture]; if (!culturedFile.Data.ContainsKey(data.Name)) { notExisting.Add(data); } } else { notExisting.Add(data); } } } return(notExisting); }
public List<ResourceDataBase> GetItemsNotExistingInCulture(VSCulture culture) { List<ResourceDataBase> notExisting = new List<ResourceDataBase>(); foreach (IResourceFile file in files) { foreach (ResourceDataBase data in file.Data.Values) { if (data.ResxFile.FileGroup.Files.ContainsKey(culture.Culture)) { IResourceFile culturedFile = data.ResxFile.FileGroup.Files[culture.Culture]; if (!culturedFile.Data.ContainsKey(data.Name)) { notExisting.Add(data); } } else { notExisting.Add(data); } } } return notExisting; }
public CultureAnalysisResultTreeNode(VSCulture sourceCulture, VSCulture targetCulture) : base() { this.ImageIndex = 5; this.SelectedImageIndex = 5; this.TargetCulture = targetCulture; this.SourceCulture = sourceCulture; }
private void loadNotExistings(TreeNode parent, VSCulture culture) { foreach (VSCulture targetCulture in Main.CurrentSolution.Cultures.Values) { if (targetCulture != culture) { var notexistingNode = new CultureAnalysisResultTreeNode(culture, targetCulture); parent.Nodes.Add(notexistingNode); loadNotExistings(notexistingNode); } } }
internal int fillTranslations(VSCulture sourceCulture, VSCulture targetCulture) { int found = 0; try { setToolbarStatusText(Properties.Resources.SearchingTranslations); List<ResourceDataBase> notexisting = sourceCulture.GetItemsNotExistingInCulture(targetCulture); var trans = new TranslationStorageManager(); int process = 1; foreach (var data in notexisting) { setToolbarStatusText(String.Format(Properties.Resources.SerachingTranslationsProcess, process, notexisting.Count())); var result = trans.Search(data, targetCulture.Culture); if (result.Count() > 0) { found++; data.ResxFile.FileGroup.SetResourceData(data.Name, result.First().Text, targetCulture.Culture); } process++; } setToolbarStatusText(String.Format(Properties.Resources.SearchingTranslationsResult, found), 4000); } catch { resetToolbarStatusText(); throw; } finally { } return found; }
public CultureTreeNode(VSCulture culture) { this.culture = culture; setText(); }
public CultureListBoxEntry(VSCulture c) { this.Culture = c; }