add shortcut indexer to translation API (#296)

This commit is contained in:
Jesse Plamondon-Willard 2017-05-28 01:06:35 -04:00
parent 01197b0eb1
commit 12ffd9c334
2 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,10 @@ namespace StardewModdingAPI.Framework
/// <summary>The game's current language code.</summary>
public LocalizedContentManager.LanguageCode LocaleEnum { get; private set; }
/// <summary>Get a translation for the current locale. This is a convenience shortcut for <see cref="ITranslationHelper.Translate"/>.</summary>
/// <param name="key">The translation key.</param>
public Translation this[string key] => this.Translate(key);
/*********
** Public methods

View File

@ -15,6 +15,10 @@ namespace StardewModdingAPI
/// <summary>The game's current language code.</summary>
LocalizedContentManager.LanguageCode LocaleEnum { get; }
/// <summary>Get a translation for the current locale. This is a convenience shortcut for <see cref="Translate"/>.</summary>
/// <param name="key">The translation key.</param>
Translation this[string key] { get; }
/*********
** Public methods