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 @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IModuleService ModuleService @inject IModuleService ModuleService
@inject IStringLocalizer<Export> Localizer
<table class="table table-borderless"> <table class="table table-borderless">
<tbody> <tbody>
<tr> <tr>
<td> <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>
<td> <td>
<textarea id="content" class="form-control" @bind="@_content" rows="5"></textarea> <textarea id="content" class="form-control" @bind="@_content" rows="5"></textarea>
@ -15,8 +16,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<button type="button" class="btn btn-success" @onclick="ExportModule">Export</button> <button type="button" class="btn btn-success" @onclick="ExportModule">@Localizer["Export"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {

View File

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

View File

@ -1,18 +1,19 @@
@namespace Oqtane.Modules.Admin.Modules @namespace Oqtane.Modules.Admin.Modules
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject IModuleService ModuleService @inject IModuleService ModuleService
@inject IPageModuleService PageModuleService @inject IPageModuleService PageModuleService
@inject IStringLocalizer<Settings> Localizer
<TabStrip> <TabStrip>
<TabPanel Name="Settings" Heading="Module Settings"> <TabPanel Name="Settings" Heading="Module Settings" ResourceKey="ModuleSettings">
@if (_containers != null) @if (_containers != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <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>
<td> <td>
<input id="title" type="text" name="Title" class="form-control" @bind="@_title" /> <input id="title" type="text" name="Title" class="form-control" @bind="@_title" />
@ -20,11 +21,11 @@
</tr> </tr>
<tr> <tr>
<td> <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>
<td> <td>
<select id="container" class="form-control" @bind="@_containerType"> <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) @foreach (var container in _containers)
{ {
<option value="@container.TypeName">@container.Name</option> <option value="@container.TypeName">@container.Name</option>
@ -34,18 +35,18 @@
</tr> </tr>
<tr> <tr>
<td> <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>
<td> <td>
<select id="allpages" class="form-control" @bind="@_allPages"> <select id="allpages" class="form-control" @bind="@_allPages">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <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>
<td> <td>
<select id="page" class="form-control" @bind="@_pageId"> <select id="page" class="form-control" @bind="@_pageId">
@ -62,7 +63,7 @@
</table> </table>
} }
</TabPanel> </TabPanel>
<TabPanel Name="Permissions"> <TabPanel Name="Permissions" ResourceKey="Permissions">
@if (_permissions != null) @if (_permissions != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
@ -76,13 +77,13 @@
</TabPanel> </TabPanel>
@if (_settingsModuleType != null) @if (_settingsModuleType != null)
{ {
<TabPanel Name="ModuleSettings" Heading="@_settingstitle"> <TabPanel Name="ModuleSettings" Heading="@_settingstitle" ResourceKey="Module Settings">
@DynamicComponent @DynamicComponent
</TabPanel> </TabPanel>
} }
</TabStrip> </TabStrip>
<button type="button" class="btn btn-success" @onclick="SaveModule">Save</button> <button type="button" class="btn btn-success" @onclick="SaveModule">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {
private List<ThemeControl> _containers = new List<ThemeControl>(); private List<ThemeControl> _containers = new List<ThemeControl>();