summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/StardewModdingAPI/Framework/ModHelpers/ContentHelper.cs6
-rw-r--r--src/StardewModdingAPI/IContentHelper.cs7
2 files changed, 13 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/ModHelpers/ContentHelper.cs b/src/StardewModdingAPI/Framework/ModHelpers/ContentHelper.cs
index 1e987f00..e94d309e 100644
--- a/src/StardewModdingAPI/Framework/ModHelpers/ContentHelper.cs
+++ b/src/StardewModdingAPI/Framework/ModHelpers/ContentHelper.cs
@@ -40,6 +40,12 @@ namespace StardewModdingAPI.Framework.ModHelpers
/*********
** Accessors
*********/
+ /// <summary>The game's current locale code (like <c>pt-BR</c>).</summary>
+ public string CurrentLocale => this.ContentManager.GetLocale();
+
+ /// <summary>The game's current locale as an enum value.</summary>
+ public LocalizedContentManager.LanguageCode CurrentLocaleConstant => this.ContentManager.GetCurrentLanguage();
+
/// <summary>The observable implementation of <see cref="AssetEditors"/>.</summary>
internal ObservableCollection<IAssetEditor> ObservableAssetEditors { get; } = new ObservableCollection<IAssetEditor>();
diff --git a/src/StardewModdingAPI/IContentHelper.cs b/src/StardewModdingAPI/IContentHelper.cs
index f32c1d18..b4557134 100644
--- a/src/StardewModdingAPI/IContentHelper.cs
+++ b/src/StardewModdingAPI/IContentHelper.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
+using StardewValley;
namespace StardewModdingAPI
{
@@ -19,6 +20,12 @@ namespace StardewModdingAPI
IList<IAssetEditor> AssetEditors { get; }
#endif
+ /// <summary>The game's current locale code (like <c>pt-BR</c>).</summary>
+ string CurrentLocale { get; }
+
+ /// <summary>The game's current locale as an enum value.</summary>
+ LocalizedContentManager.LanguageCode CurrentLocaleConstant { get; }
+
/*********
** Public methods