Merge pull request #928 from hishamco/localize-modules-pages

Localize Modules Pages
This commit is contained in:
Shaun Walker 2020-11-20 10:24:49 -05:00 committed by GitHub
commit 2ead8fc850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 21 deletions

View File

@ -1,13 +1,14 @@
@namespace Oqtane.Modules.Admin.Modules
@namespace Oqtane.Modules.Admin.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IModuleService ModuleService
@inject IStringLocalizer<Export> Localizer
<table class="table table-borderless">
<tbody>
<tr>
<td>
<Label For="content" HelpText="Enter the module content">Content: </Label>
<Label For="content" HelpText="Enter the module content" ResourceKey="Content">Content: </Label>
</td>
<td>
<textarea id="content" class="form-control" @bind="@_content" rows="5"></textarea>
@ -15,8 +16,8 @@
</tr>
</tbody>
</table>
<button type="button" class="btn btn-success" @onclick="ExportModule">Export</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<button type="button" class="btn btn-success" @onclick="ExportModule">@Localizer["Export"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code {

View File

@ -1,13 +1,14 @@
@namespace Oqtane.Modules.Admin.Modules
@namespace Oqtane.Modules.Admin.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IModuleService ModuleService
@inject IStringLocalizer<Import> Localizer
<table class="table table-borderless">
<tbody>
<tr>
<td>
<Label For="content" HelpText="Enter the module content">Content: </Label>
<Label For="content" HelpText="Enter the module content" ResourceKey="Content">Content: </Label>
</td>
<td>
<textarea id="content" class="form-control" @bind="@_content" rows="5"></textarea>
@ -15,8 +16,8 @@
</tr>
</tbody>
</table>
<button type="button" class="btn btn-success" @onclick="ImportModule">Import</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<button type="button" class="btn btn-success" @onclick="ImportModule">@Localizer["Import"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code {

View File

@ -1,18 +1,19 @@
@namespace Oqtane.Modules.Admin.Modules
@namespace Oqtane.Modules.Admin.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IThemeService ThemeService
@inject IModuleService ModuleService
@inject IPageModuleService PageModuleService
@inject IStringLocalizer<Settings> Localizer
<TabStrip>
<TabPanel Name="Settings" Heading="Module Settings">
<TabPanel Name="Settings" Heading="Module Settings" ResourceKey="ModuleSettings">
@if (_containers != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="title" HelpText="Enter the title of the module">Title: </Label>
<Label For="title" HelpText="Enter the title of the module" ResourceKey="Title">Title: </Label>
</td>
<td>
<input id="title" type="text" name="Title" class="form-control" @bind="@_title" />
@ -20,11 +21,11 @@
</tr>
<tr>
<td>
<Label For="container" HelpText="Select the module's container">Container: </Label>
<Label For="container" HelpText="Select the module's container" ResourceKey="Container">Container: </Label>
</td>
<td>
<select id="container" class="form-control" @bind="@_containerType">
<option value="-">&lt;Inherit From Page Or Site&gt;</option>
<option value="-">&lt;@Localizer["Inherit From Page Or Site"]&gt;</option>
@foreach (var container in _containers)
{
<option value="@container.TypeName">@container.Name</option>
@ -34,18 +35,18 @@
</tr>
<tr>
<td>
<Label For="allpages" HelpText="Indicate if this module should be displayed on all pages">Display On All Pages? </Label>
<Label For="allpages" HelpText="Indicate if this module should be displayed on all pages" ResourceKey="DisplayOnAllPages">Display On All Pages? </Label>
</td>
<td>
<select id="allpages" class="form-control" @bind="@_allPages">
<option value="True">Yes</option>
<option value="False">No</option>
<option value="True">@Localizer["Yes"]</option>
<option value="False">@Localizer["No"]</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="page" HelpText="The page that the module is on">Page: </Label>
<Label For="page" HelpText="The page that the module is on" ResourceKey="Page">Page: </Label>
</td>
<td>
<select id="page" class="form-control" @bind="@_pageId">
@ -62,7 +63,7 @@
</table>
}
</TabPanel>
<TabPanel Name="Permissions">
<TabPanel Name="Permissions" ResourceKey="Permissions">
@if (_permissions != null)
{
<table class="table table-borderless">
@ -76,13 +77,13 @@
</TabPanel>
@if (_settingsModuleType != null)
{
<TabPanel Name="ModuleSettings" Heading="@_settingstitle">
<TabPanel Name="ModuleSettings" Heading="@_settingstitle" ResourceKey="Module Settings">
@DynamicComponent
</TabPanel>
}
</TabStrip>
<button type="button" class="btn btn-success" @onclick="SaveModule">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<button type="button" class="btn btn-success" @onclick="SaveModule">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code {
private List<ThemeControl> _containers = new List<ThemeControl>();