using System.Globalization; using JetBrains.Annotations; namespace Robust.Shared.Localization { // ReSharper disable once CommentTypo /// /// Provides facilities to automatically translate in-game text. /// /// /// /// The translation API is similar to GNU gettext. /// You pass a string through it (most often the English version), /// and when the game is ran in another language with adequate translation, the translation is returned instead. /// /// /// [PublicAPI] public interface ILocalizationManager { /// /// Gets a string translated for the current culture. /// /// The string to get translated. /// /// The translated string if a translation is available, otherwise the string is returned. /// string GetString(string text); /// /// Version of that also runs string formatting. /// [StringFormatMethod("text")] string GetString(string text, params object[] args); /// /// Gets a string inside a context or category. /// string GetParticularString(string context, string text); /// /// Gets a string inside a context or category with formatting. /// [StringFormatMethod("text")] string GetParticularString(string context, string text, params object[] args); string GetPluralString(string text, string pluralText, long n); [StringFormatMethod("pluralText")] string GetPluralString(string text, string pluralText, long n, params object[] args); string GetParticularPluralString(string context, string text, string pluralText, long n); [StringFormatMethod("pluralText")] string GetParticularPluralString(string context, string text, string pluralText, long n, params object[] args); /// /// Default culture used by other methods when no culture is explicitly specified. /// Changing this also changes the current thread's culture. /// CultureInfo DefaultCulture { get; set; } /// /// Load data for a culture. /// /// void LoadCulture(CultureInfo culture); } }