Fallback to English as default culture

This commit is contained in:
hishamco
2020-11-17 22:28:17 +03:00
parent 2b371b2a9f
commit d8d1412a8f
5 changed files with 30 additions and 9 deletions

View File

@ -24,10 +24,25 @@ namespace Oqtane.Modules.Controls
{
return name;
}
return _localizer?[key] ?? name;
}
protected string Localize(string name, string defaultValue)
{
var key = $"{ResourceKey}.{name}";
var value = Localize(name);
if (value == key)
{
return defaultValue;
}
else
{
return value;
}
}
protected override void OnParametersSet()
{
if (!String.IsNullOrEmpty(ResourceKey))