|
@@ -24,36 +24,29 @@ namespace PDFViewer
|
|
|
public partial class App: Application
|
|
|
{
|
|
|
public static bool DefaultPDFLoaded = false;
|
|
|
- public static string CurrentLanguage = Settings.Default.Language;
|
|
|
- public static Dictionary<string, string> Languages= new Dictionary<string, string>()
|
|
|
+ public static string CurrentCulture = Settings.Default.Cultrue;
|
|
|
+ public static List<string> SupportedCultureList= new List<string>()
|
|
|
{
|
|
|
- {"English","en-US"}, {"简体中文","zh-CN"}
|
|
|
+ "en-US", "zh-CN"
|
|
|
};
|
|
|
public static FilePathList OpenedFilePathList = new FilePathList();
|
|
|
public static ResourceManager MainResourceManager = new ResourceManager("PDFViewer.Strings.SettingDialog", Assembly.GetExecutingAssembly());
|
|
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
|
{
|
|
|
- string currentCulture;
|
|
|
- if (string.IsNullOrEmpty(CurrentLanguage))
|
|
|
+ if (string.IsNullOrEmpty(CurrentCulture))
|
|
|
{
|
|
|
- currentCulture = CultureInfo.CurrentCulture.Name;
|
|
|
- CurrentLanguage = Languages.FirstOrDefault(x => x.Value == currentCulture).Key;
|
|
|
- if (!Languages.ContainsValue(currentCulture))
|
|
|
+ CurrentCulture = CultureInfo.CurrentCulture.Name;
|
|
|
+ if (!SupportedCultureList.Contains(CurrentCulture))
|
|
|
{
|
|
|
- CurrentLanguage = "English";
|
|
|
- currentCulture = "en-US";
|
|
|
+ CurrentCulture = "en-US";
|
|
|
}
|
|
|
- Settings.Default.Language = CurrentLanguage;
|
|
|
+ Settings.Default.Cultrue = CurrentCulture;
|
|
|
Settings.Default.Save();
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- currentCulture = Languages.TryGetValue(CurrentLanguage, out currentCulture) ? currentCulture : "en-US";
|
|
|
- }
|
|
|
|
|
|
- Thread.CurrentThread.CurrentUICulture = new CultureInfo(currentCulture);
|
|
|
- Thread.CurrentThread.CurrentCulture = new CultureInfo(currentCulture);
|
|
|
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo(CurrentCulture);
|
|
|
+ Thread.CurrentThread.CurrentCulture = new CultureInfo(CurrentCulture);
|
|
|
base.OnStartup(e);
|
|
|
LicenseVerify();
|
|
|
FileHistoryHelper<PDFFileInfo>.Instance.LoadHistory();
|