Add strings for entire baselayout

This commit is contained in:
jvyden 2022-04-14 16:50:30 -04:00
parent 3e18d79fa5
commit 1b48a71062
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 38 additions and 10 deletions

View file

@ -25,22 +25,44 @@
</resheader> </resheader>
<data name="header_home" xml:space="preserve"> <data name="header_home" xml:space="preserve">
<value>Home</value> <value>Home</value>
<comment>A button on the header that takes you to the landing page.</comment> <comment>A button on the header that takes you to the landing page.</comment>
</data> </data>
<data name="header_users" xml:space="preserve"> <data name="header_users" xml:space="preserve">
<value>Users</value> <value>Users</value>
<comment>A button on the header that takes you to the user listing.</comment> <comment>A button on the header that takes you to the user listing.</comment>
</data> </data>
<data name="header_photos" xml:space="preserve"> <data name="header_photos" xml:space="preserve">
<value>Photos</value> <value>Photos</value>
<comment>A button on the header that takes you to a list of user-uploaded photos.</comment> <comment>A button on the header that takes you to a list of user-uploaded photos.</comment>
</data> </data>
<data name="header_slots" xml:space="preserve"> <data name="header_slots" xml:space="preserve">
<value>Levels</value> <value>Levels</value>
<comment>A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots".</comment> <comment>A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots".</comment>
</data> </data>
<data name="header_authentication" xml:space="preserve">
<value>Authentication</value>
<comment>A button on the header that takes you to a list of authentication attempts.</comment>
</data>
<data name="header_loginRegister" xml:space="preserve">
<value>Login / Register</value>
<comment>A button on the header that lets you log in or register.</comment>
</data>
<data name="header_profile" xml:space="preserve">
<value>Profile</value>
<comment>A quick shortcut on the header to take you to your profile if logged in.</comment>
</data>
<data name="header_adminPanel" xml:space="preserve">
<value>Admin Panel</value>
<comment>A header link that takes you to the admin panel if available.</comment>
</data>
<data name="header_logout" xml:space="preserve">
<value>Log out</value>
<comment>A shortcut to log you out of your account.</comment>
</data>
</root> </root>

View file

@ -6,6 +6,12 @@ public static class BaseLayoutStrings
public static readonly TranslatableString HeaderUsers = create("header_users"); public static readonly TranslatableString HeaderUsers = create("header_users");
public static readonly TranslatableString HeaderPhotos = create("header_photos"); public static readonly TranslatableString HeaderPhotos = create("header_photos");
public static readonly TranslatableString HeaderSlots = create("header_slots"); public static readonly TranslatableString HeaderSlots = create("header_slots");
public static readonly TranslatableString HeaderAuthentication = create("header_authentication");
public static readonly TranslatableString HeaderLoginRegister = create("header_loginRegister");
public static readonly TranslatableString HeaderProfile = create("header_profile");
public static readonly TranslatableString HeaderAdminPanel = create("header_adminPanel");
public static readonly TranslatableString HeaderLogout = create("header_logout");
private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key); private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key);
} }

View file

@ -1,6 +1,6 @@
@using LBPUnion.ProjectLighthouse.Helpers @using LBPUnion.ProjectLighthouse.Helpers
@using LBPUnion.ProjectLighthouse.Helpers.Extensions @using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Localization @using LBPUnion.ProjectLighthouse.Localization.StringLists
@using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types
@using LBPUnion.ProjectLighthouse.Types.Settings @using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout @model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout
@ -8,21 +8,21 @@
@{ @{
if (Model!.User == null) if (Model!.User == null)
{ {
Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Login / Register"), "/login", "sign in")); Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLoginRegister, "/login", "sign in"));
} }
else else
{ {
if (ServerSettings.Instance.UseExternalAuth) if (ServerSettings.Instance.UseExternalAuth)
{ {
Model.NavigationItems.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Authentication"), "/authentication", "key")); Model.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAuthentication, "/authentication", "key"));
} }
Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Profile"), "/user/" + Model.User.UserId, "user alternate")); Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderProfile, "/user/" + Model.User.UserId, "user alternate"));
@if (Model.User.IsAdmin) @if (Model.User.IsAdmin)
{ {
Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Admin Panel"), "/admin", "cogs")); Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAdminPanel, "/admin", "cogs"));
} }
Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Log out"), "/logout", "user alternate slash")); // should always be last Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLogout, "/logout", "user alternate slash")); // should always be last
} }
Model.IsMobile = Model.Request.IsMobile(); Model.IsMobile = Model.Request.IsMobile();