mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 17:57:01 +08:00
feat: 修改本地化翻译的读取逻辑
This commit is contained in:
@@ -15,6 +15,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace MeoAsstGui
|
||||
{
|
||||
@@ -92,18 +93,20 @@ namespace MeoAsstGui
|
||||
culture = Localization.culture;
|
||||
}
|
||||
|
||||
var dictionary = new ResourceDictionary
|
||||
var culureList = new string[] { culture, "en-us", "zh-cn", };
|
||||
foreach (var curCulutre in culureList)
|
||||
{
|
||||
Source = new Uri($@"Resources\Localizations\{culture}.xaml", UriKind.Relative),
|
||||
};
|
||||
if (dictionary.Contains(key))
|
||||
{
|
||||
return dictionary[key] as string;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"{{{{ {key} }}}}";
|
||||
var dictionary = new ResourceDictionary
|
||||
{
|
||||
Source = new Uri($@"Resources\Localizations\{curCulutre}.xaml", UriKind.Relative),
|
||||
};
|
||||
if (dictionary.Contains(key))
|
||||
{
|
||||
return dictionary[key] as string;
|
||||
}
|
||||
}
|
||||
|
||||
return $"{{{{ {key} }}}}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user