mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-05 02:12:26 +00:00
Set default language to en-US
This commit is contained in:
parent
1b48a71062
commit
3dd63e6522
2 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ namespace LBPUnion.ProjectLighthouse.Localization;
|
||||||
public static class LocalizationManager
|
public static class LocalizationManager
|
||||||
{
|
{
|
||||||
private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? "";
|
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)
|
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.
|
// 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
|
// Otherwise, keep it to the normal .resx file
|
||||||
// e.g. BaseLayout.resx as opposed to BaseLayout.lang-da-DK.resx.
|
// 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());
|
ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly());
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public static class LocalizationManager
|
||||||
.Where(r => r != "resources")
|
.Where(r => r != "resources")
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
languages.Add(defaultLang);
|
languages.Add(DefaultLang);
|
||||||
|
|
||||||
return languages;
|
return languages;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BaseLayout : PageModel
|
||||||
string lang;
|
string lang;
|
||||||
IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get<IRequestCultureFeature>();
|
IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get<IRequestCultureFeature>();
|
||||||
|
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
lang = requestCulture.RequestCulture.UICulture.Name;
|
lang = requestCulture.RequestCulture.UICulture.Name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue