コード例 #1
0
        static void LocalizeViewer(string viewerDirectory)
        {
            LocalizedFiles localizedFiles = new LocalizedFiles();

            foreach (Template template in localizedFiles.BuilderInfo.Templates)
            {
                LocalizeFiles(template.XmlTemplateFiles, viewerDirectory, true);
                LocalizeFiles(template.TextTemplateFiles, viewerDirectory);
            }
        }
コード例 #2
0
        static void LocalizeBuilder(string builderDirectory)
        {
            LocalizedFiles localizedFiles = new LocalizedFiles();

            foreach (string file in localizedFiles.BuilderInfo.BuilderFiles)
            {
                foreach (string culture in Cultures.Supported)
                {
                    bool isXmlFile = file.ToLower().EndsWith(".xml", StringComparison.OrdinalIgnoreCase) ||
                                     file.ToLower().EndsWith(".xaml", StringComparison.OrdinalIgnoreCase);
                    ReplaceStrings(culture, file, builderDirectory, isXmlFile);
                }
                string englishFile = Path.Combine(builderDirectory, "Culture", "en-US", file);
                if (File.Exists(englishFile))
                {
                    string originalFile = Path.Combine(builderDirectory, file);
                    RemoveReadOnly(originalFile);
                    File.Copy(englishFile, originalFile, true);
                }
            }
        }