mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
Fix FindResource
http://windowsasusual.blogspot.ie/2015/10/wpf-applicationcurrentfindresource-and.html
This commit is contained in:
@@ -88,20 +88,15 @@ namespace Wox.Core.i18n
|
||||
|
||||
public string GetTranslation(string key)
|
||||
{
|
||||
try
|
||||
var translation = Application.Current.TryFindResource(key);
|
||||
if (translation is string)
|
||||
{
|
||||
object translation = Application.Current.FindResource(key);
|
||||
if (translation == null)
|
||||
{
|
||||
return "NoTranslation";
|
||||
}
|
||||
return translation.ToString();
|
||||
}
|
||||
catch
|
||||
else
|
||||
{
|
||||
return "NoTranslation";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private string GetLanguagePath(string languageCode)
|
||||
|
||||
Reference in New Issue
Block a user