public ReadFiles ( string directory, |
||
directory | string | |
culture | ||
Résultat | void |
public void LoadFiles(string directory, CultureInfo culture) { resourceDirectory = new ResourceDirectory(); resourceDirectory.ReadFiles(directory, culture); resourceDirectory.ReadResources(); PopulateListView(); }
public void LoadFiles(string directory, CultureInfo culture) { resourceDirectory = new ResourceDirectory(); resourceDirectory.ReadFiles(directory, culture); resourceDirectory.ReadResources(); PopulateListView(); }
private void SynchronizePoFile(string resxDirectory, string poDirectory, string baseName, CultureInfo culture, string programName, string email, string version, TextWriter statusOutput) { ResourceDirectory resourceDirectory = new ResourceDirectory(); statusOutput.WriteLine("Reading RESX directory '{0}' for culture '{1}'", resxDirectory, culture.Name); resourceDirectory.ReadFiles(resxDirectory, culture); resourceDirectory.ReadResources(); foreach (var resX in resourceDirectory.AllFiles) { statusOutput.WriteLine(" {0}", resX); } statusOutput.WriteLine(); string cultureName = culture.Name; if (cultureName.EndsWith("-NO")) { cultureName = cultureName.Substring(0, 2); } cultureName = cultureName.Replace("-", "_"); string poFileName = Path.Combine(poDirectory, baseName + "-" + cultureName + ".po"); statusOutput.WriteLine("Reading PO file '{0}' for culture '{1}'", poFileName, culture.Name); PoReader reader = new PoReader(poFileName); List <PoEntry> entries = reader.ReadPo(); ApplyPo applyPo = new ApplyPo(); applyPo.Apply(entries, resourceDirectory, statusOutput); resourceDirectory.WriteResources(); PoWriterAttributes attributes = new PoWriterAttributes() { Name = programName, Email = email, Version = version, writePOT = false }; PoWriter potWriter = new PoWriter(poFileName, attributes); potWriter.WritePot(resourceDirectory); }
private void SynchronizePot(string resxDirectory, string potFileName, string programName, string email, string version) { ResourceDirectory resourceDirectory = new ResourceDirectory(); resourceDirectory.ReadFiles(resxDirectory, CultureInfo.GetCultureInfo("en")); resourceDirectory.ReadResources(); PoWriterAttributes attributes = new PoWriterAttributes() { Name = programName, Email = email, Version = version, writePOT = true }; PoWriter potWriter = new PoWriter(potFileName, attributes); potWriter.WritePot(resourceDirectory); }
private void SynchronizePot(string resxDirectory, string potFileName, string programName, string email, string version) { ResourceDirectory resourceDirectory = new ResourceDirectory(); resourceDirectory.ReadFiles(resxDirectory, CultureInfo.GetCultureInfo("en")); resourceDirectory.ReadResources(); PoWriterAttributes attributes = new PoWriterAttributes() { Name = programName, Email = email, Version = version, writePOT = true }; PoWriter potWriter = new PoWriter(potFileName, attributes); potWriter.WritePot(resourceDirectory); }
private void SynchronizePoFile(string resxDirectory, string poDirectory, string baseName, CultureInfo culture, string programName, string email, string version, TextWriter statusOutput) { ResourceDirectory resourceDirectory = new ResourceDirectory(); statusOutput.WriteLine("Reading RESX directory '{0}' for culture '{1}'", resxDirectory, culture.Name); resourceDirectory.ReadFiles(resxDirectory, culture); resourceDirectory.ReadResources(); foreach (var resX in resourceDirectory.AllFiles) { statusOutput.WriteLine(" {0}", resX); } statusOutput.WriteLine(); string cultureName = culture.Name; if (cultureName.EndsWith("-NO")) cultureName = cultureName.Substring(0, 2); cultureName = cultureName.Replace("-", "_"); string poFileName = Path.Combine(poDirectory, baseName + "-" + cultureName + ".po"); statusOutput.WriteLine("Reading PO file '{0}' for culture '{1}'", poFileName, culture.Name); PoReader reader = new PoReader(poFileName); List<PoEntry> entries = reader.ReadPo(); ApplyPo applyPo = new ApplyPo(); applyPo.Apply(entries, resourceDirectory, statusOutput); resourceDirectory.WriteResources(); PoWriterAttributes attributes = new PoWriterAttributes() { Name = programName, Email = email, Version = version, writePOT = false }; PoWriter potWriter = new PoWriter(poFileName, attributes); potWriter.WritePot(resourceDirectory); }
public void ReadDirectory() { string directory = GetTestFileDirectory(); ResourceDirectory resdir = new ResourceDirectory(); resdir.ReadFiles(directory, new CultureInfo("de")); resdir.ReadResources(); foreach (ResXFile resxfile in resdir.AllFiles) { Console.WriteLine("Nonlocalized ResXFile: {0} LocalizedResXFile: {1}", resxfile.NonLocalizedFileName, resxfile.LocalizedFileName); Console.WriteLine("----------------------------------------------------------------"); foreach (LocString locstr in resxfile.AllStrings) { Console.WriteLine(" Name:{0} NonLocValue:{1} LocValue:{2} Comment:{3}", locstr.Name, locstr.NonLocalized, locstr.Localized, locstr.Comment); } Console.WriteLine(); } }