private void GetLocalResourceFiles(LocaleFileCollection ResFileList, string RootPath, string LocaleCode, LocaleType ResType, DirectoryInfo objFolder) { FileInfo objFile; FileInfo[] ascxFiles; FileInfo[] aspxFiles; if (LocaleCode == Localization.SystemLocale) { // This is the case for en-US which is the default locale ascxFiles = objFolder.GetFiles("*.ascx.resx"); aspxFiles = objFolder.GetFiles("*.aspx.resx"); } else { ascxFiles = objFolder.GetFiles("*.ascx." + LocaleCode + ".resx"); aspxFiles = objFolder.GetFiles("*.aspx." + LocaleCode + ".resx"); } foreach (FileInfo tempLoopVar_objFile in ascxFiles) { objFile = tempLoopVar_objFile; ResFileList.Add(GetLocaleFile(ref RootPath, ResType, objFile)); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), objFile.Name)); } foreach (FileInfo tempLoopVar_objFile in aspxFiles) { objFile = tempLoopVar_objFile; ResFileList.Add(GetLocaleFile(ref RootPath, ResType, objFile)); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), objFile.Name)); } }
private void GetGlobalResourceFiles(LocaleFileCollection ResFileList, string LocaleCode) { FileInfo objFile; DirectoryInfo objFolder = new DirectoryInfo(GetServerPath(Localization.ApplicationResourceDirectory)); FileInfo[] Files; FileInfo TimeZoneFile; if (LocaleCode == Localization.SystemLocale) { // This is the case for en-US which is the default locale Files = objFolder.GetFiles("*.resx"); int LastIndex = Files.Length; Files = (FileInfo[])Utils.CopyArray((Array)Files, new FileInfo[LastIndex + 1]); TimeZoneFile = new FileInfo(Path.Combine(objFolder.FullName, "TimeZones.xml")); Files[LastIndex] = TimeZoneFile; } else { Files = objFolder.GetFiles("*." + LocaleCode + ".resx"); int LastIndex = Files.Length; Files = (FileInfo[])Utils.CopyArray((Array)Files, new FileInfo[LastIndex + 1]); TimeZoneFile = new FileInfo(Path.Combine(objFolder.FullName, "TimeZones." + LocaleCode + ".xml")); Files[LastIndex] = TimeZoneFile; } foreach (FileInfo tempLoopVar_objFile in Files) { objFile = tempLoopVar_objFile; if ((!objFile.Name.StartsWith("Template")) && (LocaleCode != Localization.SystemLocale || (LocaleCode == Localization.SystemLocale && objFile.Name.IndexOf('.') == objFile.Name.LastIndexOf('.')))) { LocaleFileInfo LocaleFile = new LocaleFileInfo(); LocaleFile.LocaleFileName = objFile.Name; //Since paths are relative and all global resources exist in a known directory, // we don't need a path. LocaleFile.LocalePath = null; LocaleFile.LocaleFileType = LocaleType.GlobalResource; LocaleFile.Buffer = GetFileAsByteArray(objFile); ResFileList.Add(LocaleFile); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), objFile.Name)); } } }
private void GetLocalSharedResourceFile(LocaleFileCollection ResFileList, string RootPath, string LocaleCode, LocaleType ResType, DirectoryInfo objFolder) { FileInfo SharedFile; string strFilePath; if (LocaleCode == Localization.SystemLocale) { // This is the case for en-US which is the default locale strFilePath = Path.Combine(objFolder.FullName, "SharedResources.resx"); } else { strFilePath = Path.Combine(objFolder.FullName, "SharedResources." + LocaleCode + ".resx"); } if (File.Exists(strFilePath)) { SharedFile = new FileInfo(strFilePath); ResFileList.Add(GetLocaleFile(ref RootPath, ResType, SharedFile)); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), SharedFile.Name)); } }
private void GetLocalSharedResourceFile( LocaleFileCollection ResFileList, string RootPath, string LocaleCode, LocaleType ResType, DirectoryInfo objFolder ) { FileInfo SharedFile; string strFilePath; if (LocaleCode == Localization.SystemLocale) { // This is the case for en-US which is the default locale strFilePath = Path.Combine(objFolder.FullName, "SharedResources.resx"); } else { strFilePath = Path.Combine(objFolder.FullName, "SharedResources." + LocaleCode + ".resx"); } if (File.Exists(strFilePath)) { SharedFile = new FileInfo(strFilePath); ResFileList.Add(GetLocaleFile(ref RootPath, ResType, SharedFile)); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), SharedFile.Name)); } }
private void GetLocalResourceFiles( LocaleFileCollection ResFileList, string RootPath, string LocaleCode, LocaleType ResType, DirectoryInfo objFolder ) { FileInfo objFile; FileInfo[] ascxFiles; FileInfo[] aspxFiles; if (LocaleCode == Localization.SystemLocale) { // This is the case for en-US which is the default locale ascxFiles = objFolder.GetFiles("*.ascx.resx"); aspxFiles = objFolder.GetFiles("*.aspx.resx"); } else { ascxFiles = objFolder.GetFiles("*.ascx." + LocaleCode + ".resx"); aspxFiles = objFolder.GetFiles("*.aspx." + LocaleCode + ".resx"); } foreach (FileInfo tempLoopVar_objFile in ascxFiles) { objFile = tempLoopVar_objFile; ResFileList.Add(GetLocaleFile(ref RootPath, ResType, objFile)); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), objFile.Name)); } foreach (FileInfo tempLoopVar_objFile in aspxFiles) { objFile = tempLoopVar_objFile; ResFileList.Add(GetLocaleFile(ref RootPath, ResType, objFile)); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), objFile.Name)); } }
private void GetGlobalResourceFiles( LocaleFileCollection ResFileList, string LocaleCode ) { FileInfo objFile; DirectoryInfo objFolder = new DirectoryInfo(GetServerPath(Localization.ApplicationResourceDirectory)); FileInfo[] Files; FileInfo TimeZoneFile; if (LocaleCode == Localization.SystemLocale) { // This is the case for en-US which is the default locale Files = objFolder.GetFiles("*.resx"); int LastIndex = Files.Length; Files = (FileInfo[])Utils.CopyArray((Array)Files, new FileInfo[LastIndex + 1]); TimeZoneFile = new FileInfo(Path.Combine(objFolder.FullName, "TimeZones.xml")); Files[LastIndex] = TimeZoneFile; } else { Files = objFolder.GetFiles("*." + LocaleCode + ".resx"); int LastIndex = Files.Length; Files = (FileInfo[])Utils.CopyArray((Array)Files, new FileInfo[LastIndex + 1]); TimeZoneFile = new FileInfo(Path.Combine(objFolder.FullName, "TimeZones." + LocaleCode + ".xml")); Files[LastIndex] = TimeZoneFile; } foreach (FileInfo tempLoopVar_objFile in Files) { objFile = tempLoopVar_objFile; if ((!objFile.Name.StartsWith("Template")) && (LocaleCode != Localization.SystemLocale || (LocaleCode == Localization.SystemLocale && objFile.Name.IndexOf('.') == objFile.Name.LastIndexOf('.')))) { LocaleFileInfo LocaleFile = new LocaleFileInfo(); LocaleFile.LocaleFileName = objFile.Name; //Since paths are relative and all global resources exist in a known directory, // we don't need a path. LocaleFile.LocalePath = null; LocaleFile.LocaleFileType = LocaleType.GlobalResource; LocaleFile.Buffer = GetFileAsByteArray(objFile); ResFileList.Add(LocaleFile); ProgressLog.AddInfo(string.Format(Localization.GetString("LOG.LangPack.LoadFileName"), objFile.Name)); } } }