Translate mod panel

This commit is contained in:
jvyden 2022-07-27 17:05:41 -04:00
parent 836e2293e0
commit bc998b1ba9
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
5 changed files with 44 additions and 2 deletions

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="mod_panel_title" xml:space="preserve">
<value>Moderation Panel</value>
</data>
<data name="greeting" xml:space="preserve">
<value>Welcome to the moderation panel, {0}!</value>
</data>
</root>

View file

@ -25,6 +25,10 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Status.Designer.cs</LastGenOutput> <LastGenOutput>Status.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="ModPanel.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ModPanel.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -0,0 +1,9 @@
namespace LBPUnion.ProjectLighthouse.Localization.StringLists;
public static class ModPanelStrings
{
public static readonly TranslatableString ModPanelTitle = create("mod_panel_title");
public static readonly TranslatableString Greeting = create("greeting");
private static TranslatableString create(string key) => new(TranslationAreas.ModPanel, key);
}

View file

@ -7,4 +7,5 @@ public enum TranslationAreas
General, General,
LoggedOut, LoggedOut,
Status, Status,
ModPanel,
} }

View file

@ -2,11 +2,12 @@
@using System.Diagnostics @using System.Diagnostics
@using LBPUnion.ProjectLighthouse.Administration @using LBPUnion.ProjectLighthouse.Administration
@using LBPUnion.ProjectLighthouse.Extensions @using LBPUnion.ProjectLighthouse.Extensions
@using LBPUnion.ProjectLighthouse.Localization.StringLists
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.ModPanelPage @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.ModPanelPage
@{ @{
Layout = "Layouts/BaseLayout"; Layout = "Layouts/BaseLayout";
Model.Title = "Moderation Panel"; Model.Title = Model.Translate(ModPanelStrings.ModPanelTitle);
if (Model.User == null) throw new ArgumentNullException($"{nameof(Model)}.{nameof(User)}"); if (Model.User == null) throw new ArgumentNullException($"{nameof(Model)}.{nameof(User)}");
@ -18,7 +19,7 @@
} }
} }
<p>Hello, <b>@Model.User.Username.</b></p> <p>@Model.Translate(ModPanelStrings.Greeting)</p>
@if (!this.Request.IsMobile()) @if (!this.Request.IsMobile())
{ {