C# Class NaturalResourcesBrush.TranslationFramework.Translation

Handles localisation for a mod.
ファイルを表示 Open project: earalov/Skylines-NaturalResourcesBrush

Protected Properties

Property Type Description
_currentLanguage Language
_languages List
_languagesLoaded bool
_loadLanguageAutomatically bool

Public Methods

Method Description
AvailableLanguages ( ) : List

Returns a list of languages which are available to the mod. This will return language IDs for searching.

AvailableLanguagesReadable ( ) : List

Returns a list of languages which are available to the mod. This will return readable languages for use on the UI

GetLanguageIDsFromName ( string name ) : List

Returns a list of Language unique IDs that have the name

GetTranslation ( string translationId ) : string

Gets a translation for a specific translation ID

HasTranslation ( string translationId ) : bool

Returns whether you can translate into a specific translation ID

LoadLanguages ( ) : void

Loads all languages up if not already loaded.

RefreshLanguages ( ) : void

Forces a reload of the languages, even if they're already loaded

Translation ( bool loadLanguageAutomatically = true ) : System.Collections.Generic

Protected Methods

Method Description
DeserialiseLanguage ( TextReader reader ) : Language

Deserialise a language file using a TextReader

Private Methods

Method Description
SetCurrentLanguage ( ) : void

Method Details

AvailableLanguages() public method

Returns a list of languages which are available to the mod. This will return language IDs for searching.
public AvailableLanguages ( ) : List
return List

AvailableLanguagesReadable() public method

Returns a list of languages which are available to the mod. This will return readable languages for use on the UI
public AvailableLanguagesReadable ( ) : List
return List

DeserialiseLanguage() protected method

Deserialise a language file using a TextReader
protected DeserialiseLanguage ( TextReader reader ) : Language
reader System.IO.TextReader The text to deserialise
return Language

GetLanguageIDsFromName() public method

Returns a list of Language unique IDs that have the name
public GetLanguageIDsFromName ( string name ) : List
name string The name of the language to get IDs for
return List

GetTranslation() public method

Gets a translation for a specific translation ID
public GetTranslation ( string translationId ) : string
translationId string The ID to return the translation for
return string

HasTranslation() public method

Returns whether you can translate into a specific translation ID
public HasTranslation ( string translationId ) : bool
translationId string The ID of the translation to check
return bool

LoadLanguages() public method

Loads all languages up if not already loaded.
public LoadLanguages ( ) : void
return void

RefreshLanguages() public method

Forces a reload of the languages, even if they're already loaded
public RefreshLanguages ( ) : void
return void

Translation() public method

public Translation ( bool loadLanguageAutomatically = true ) : System.Collections.Generic
loadLanguageAutomatically bool
return System.Collections.Generic

Property Details

_currentLanguage protected_oe property

protected Language,NaturalResourcesBrush.TranslationFramework _currentLanguage
return Language

_languages protected_oe property

protected List _languages
return List

_languagesLoaded protected_oe property

protected bool _languagesLoaded
return bool

_loadLanguageAutomatically protected_oe property

protected bool _loadLanguageAutomatically
return bool