diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 9401213b..7b72021d 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -7,7 +7,7 @@ namespace LBPUnion.ProjectLighthouse.Localization; public static class LocalizationManager { private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? ""; - private const string defaultLang = "en-US"; + public const string DefaultLang = "en-US"; public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) { @@ -20,7 +20,7 @@ public static class LocalizationManager // We don't have an en-US .resx, so if we aren't using en-US then we need to add the appropriate language. // Otherwise, keep it to the normal .resx file // e.g. BaseLayout.resx as opposed to BaseLayout.lang-da-DK.resx. - if (language != defaultLang) resourceBasename += $".lang-{language}"; + if (language != DefaultLang) resourceBasename += $".lang-{language}"; ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly()); @@ -50,7 +50,7 @@ public static class LocalizationManager .Where(r => r != "resources") .ToList(); - languages.Add(defaultLang); + languages.Add(DefaultLang); return languages; } diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs index e1b77818..1d5dcd29 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs @@ -49,7 +49,7 @@ public class BaseLayout : PageModel string lang; IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get(); - if (requestCulture == null) lang = "en-UD"; // TODO: change to en-US when i can verify this is working + if (requestCulture == null) lang = LocalizationManager.DefaultLang; else { lang = requestCulture.RequestCulture.UICulture.Name;