Table of Contents

Class Localization

Namespace
TinyLife
Assembly
Tiny Life.dll

A class that houses the currently loaded language as well as allows for switching the currently selected language

public static class Localization
Inheritance
Localization
Inherited Members

Fields

LanguageNames

A list of the full names of all of the languages that the game supports

public static readonly Dictionary<string, string> LanguageNames

Field Value

Dictionary<string, string>

Names

A dictionary that contains pre-defined names, used by all languages, for Tinies as well as other named objects, usually related to a Project.

public static readonly Dictionary<NameCategory, List<string>> Names

Field Value

Dictionary<NameCategory, List<string>>

Methods

Get(LnCategory, string)

Gets a localized string in the given category with the given key. If the localization is not found, the key, surrounded by question marks, is returned instead.

public static string Get(LnCategory category, string key)

Parameters

category LnCategory

The category that contains the localization

key string

The key to localize

Returns

string

The localization of the key

Get(LnCategory, string, params object[])

Gets a localized string in the given category with the given key. If the localization is not found, the key, surrounded by question marks, is returned instead.

public static string Get(LnCategory category, string key, params object[] args)

Parameters

category LnCategory

The category that contains the localization

key string

The key to localize

args object[]

An optional set of arguments that are passed to Format(IFormatProvider, string, object)

Returns

string

The localization of the key

GetBool(LnCategory, string)

public static bool GetBool(LnCategory category, string key)

Parameters

category LnCategory
key string

Returns

bool

GetKeys(LnCategory)

Returns all of the keys that are registered for localization for a given LnCategory

public static IEnumerable<string> GetKeys(LnCategory category)

Parameters

category LnCategory

The localization category

Returns

IEnumerable<string>

A set of keys

GetRandomName(Random, bool, StylePreference)

public static string GetRandomName(Random random, bool lastName, StylePreference preference = StylePreference.Neutral)

Parameters

random Random
lastName bool
preference StylePreference

Returns

string

Reload()

Reloads the strings for the current language (SetLanguage(string)) for the base game and all mods. Note that, for most ui elements to update, they have to be re-created.

public static void Reload()

SetLanguage(string)

Switches the current language to the language given. Note that, for most ui elements to update, they have to be re-created.

public static void SetLanguage(string language)

Parameters

language string

The code of the language to set