Finish translation of landing page

This commit is contained in:
jvyden 2022-07-26 16:44:19 -04:00
parent 51228b2ca1
commit 1e9f672d6c
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
7 changed files with 34 additions and 24 deletions

View file

@ -53,4 +53,12 @@
<value>You have {0} authentication attempts pending. Click here to view them.</value>
<comment>A greeting on the main page of the website.</comment>
</data>
<data name="newest_levels" xml:space="preserve">
<value>Newest Levels</value>
</data>
<data name="latest_team_picks" xml:space="preserve">
<value>Latest Team Picks</value>
</data>
</root>

View file

@ -7,7 +7,7 @@ namespace LBPUnion.ProjectLighthouse.Localization;
public static class LocalizationManager
{
private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? "";
public const string DefaultLang = "en-US";
public const string DefaultLang = "ja-JP";
public static string GetLocalizedString(TranslationAreas translationArea, string language, string key)
{

View file

@ -9,6 +9,9 @@ public static class LandingPageStrings
public static readonly TranslatableString UsersSingle = create("users_single");
public static readonly TranslatableString UsersMultiple = create("users_multiple");
public static readonly TranslatableString LatestTeamPicks = create("latest_team_picks");
public static readonly TranslatableString NewestLevels = create("newest_levels");
public static readonly TranslatableString AuthAttemptsPending = create("authAttemptsPending");
private static TranslatableString create(string key) => new(TranslationAreas.LandingPage, key);

View file

@ -13,6 +13,8 @@ public class TranslatableString
public string Translate(string language) => LocalizationManager.GetLocalizedString(this.Area, language, this.Key);
public string Translate(string language, params object?[] format) => string.Format(LocalizationManager.GetLocalizedString(this.Area, language, this.Key), format);
// CS0809 is a warning about obsolete methods overriding non-obsoleted methods.
// That works against what we're trying to do here, so we disable the warning here.
#pragma warning disable CS0809