Translation

public static class Translation
Static class which provides some cached translation methods for English -> Other.

Properties

SupportedLanguages

#
public static IEnumerable<Language> SupportedLanguages { get; }
Iterate over all supported languages, including English.

Methods

Hash

#
public static Guid Hash(string text)
Hash a string to a 128 bit hash.
text (string)

LanguageCode

#
public static string LanguageCode(Language language)
language (Language)

LanguageEnglishName

#
public static string LanguageEnglishName(Language language)
language (Language)

LanguageNativeName

#
public static string LanguageNativeName(Language language)
language (Language)

Translate

#
public static Task<string> Translate(string english, Language targetLanguage)
Low level translation function accepting a target language code. This method will return synchronously if the translation has already been cached.
english (string)
targetLanguage (Language)

TranslateAndAssign

#
public static Task<bool> TranslateAndAssign(string english, Language targetLanguage, Action<string> assignment)
Translate and assign a string. Typically you'd use this method from the UI thread and throw away the tasks it returns.
english (string)English string.
targetLanguage (Language)Target language.
assignment (Action<string>)Assigment delegate. This delegate will be invoked on the UI thread, but only if the settings UI language still equals the targetLanguage.
True if assignment was made, but this method was designed to be fire-and-forget.