Merge pull request #3156 from sbwalker/dev
migrate LocalizerFactory logic from SiteRouter to ModuleTitle component
This commit is contained in:
commit
4c5460fc9e
|
@ -3,6 +3,7 @@
|
||||||
@inherits ContainerBase
|
@inherits ContainerBase
|
||||||
@attribute [OqtaneIgnore]
|
@attribute [OqtaneIgnore]
|
||||||
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
||||||
|
@inject IStringLocalizerFactory LocalizerFactory
|
||||||
|
|
||||||
<span class="app-moduletitle">
|
<span class="app-moduletitle">
|
||||||
@((MarkupString)title)
|
@((MarkupString)title)
|
||||||
|
@ -20,7 +21,8 @@
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(ModuleState.ControlTitle))
|
if (!string.IsNullOrEmpty(ModuleState.ControlTitle))
|
||||||
{
|
{
|
||||||
title = ModuleState.ControlTitle;
|
var localizer = LocalizerFactory.Create(ModuleState.ModuleType);
|
||||||
|
title = localizer[ModuleState.ControlTitle];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
@inject IUrlMappingService UrlMappingService
|
@inject IUrlMappingService UrlMappingService
|
||||||
@inject ILogService LogService
|
@inject ILogService LogService
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
@inject IStringLocalizerFactory LocalizerFactory
|
|
||||||
@implements IHandleAfterRender
|
@implements IHandleAfterRender
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(_error))
|
@if (!string.IsNullOrEmpty(_error))
|
||||||
|
@ -465,8 +464,7 @@
|
||||||
// additional metadata needed for admin components
|
// additional metadata needed for admin components
|
||||||
if (module.ModuleId == moduleid && action != "")
|
if (module.ModuleId == moduleid && action != "")
|
||||||
{
|
{
|
||||||
var localizer = LocalizerFactory.Create(module.ModuleType);
|
module.ControlTitle = moduleobject.Title;
|
||||||
module.ControlTitle = localizer[moduleobject.Title];
|
|
||||||
module.SecurityAccessLevel = moduleobject.SecurityAccessLevel;
|
module.SecurityAccessLevel = moduleobject.SecurityAccessLevel;
|
||||||
module.Actions = moduleobject.Actions;
|
module.Actions = moduleobject.Actions;
|
||||||
module.UseAdminContainer = moduleobject.UseAdminContainer;
|
module.UseAdminContainer = moduleobject.UseAdminContainer;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user