From cc1cf5e268b1914fd358979c0b68a195460d0b03 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sat, 2 May 2020 20:01:06 +0200 Subject: [PATCH] Set current culture in shared entrypoint. --- Content.Shared/EntryPoint.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Content.Shared/EntryPoint.cs b/Content.Shared/EntryPoint.cs index a9df20ff2a..f2a1e7312e 100644 --- a/Content.Shared/EntryPoint.cs +++ b/Content.Shared/EntryPoint.cs @@ -1,23 +1,36 @@ using System; using System.Collections.Generic; + using System.Globalization; using Content.Shared.Maps; using Robust.Shared.ContentPack; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; + using Robust.Shared.Localization; using Robust.Shared.Prototypes; namespace Content.Shared { public class EntryPoint : GameShared { + // If you want to change your codebase's language, do it here. + private const string Culture = "en-US"; + #pragma warning disable 649 [Dependency] private readonly IPrototypeManager _prototypeManager; [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; + [Dependency] private readonly ILocalizationManager _localizationManager; #pragma warning restore 649 + public override void PreInit() + { + IoCManager.InjectDependencies(this); + + // Default to en-US. + _localizationManager.LoadCulture(new CultureInfo(Culture)); + } + public override void Init() { - IoCManager.InjectDependencies(this); } public override void PostInit()