blob: 84571d0eedd7ee9f22db1621f29316457d664b45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
using System.Collections.Generic;
using StardewValley;
namespace StardewModdingAPI
{
/// <summary>Provides translations stored in the mod's <c>i18n</c> folder, with one file per locale (like <c>en.json</c>) containing a flat key => value structure. Translations are fetched with locale fallback, so missing translations are filled in from broader locales (like <c>pt-BR.json</c> < <c>pt.json</c> < <c>default.json</c>).</summary>
public interface ITranslationHelper
{
/*********
** Accessors
*********/
/// <summary>The current locale.</summary>
string Locale { get; }
/// <summary>The game's current language code.</summary>
LocalizedContentManager.LanguageCode LocaleEnum { get; }
/*********
** Public methods
*********/
/// <summary>Get all translations for the current locale.</summary>
IDictionary<string, string> GetTranslations();
/// <summary>Get a translation for the current locale.</summary>
/// <param name="key">The translation key.</param>
Translation Translate(string key);
}
}
|