Detailed Description

This class simply represents a global Language service. Things such as the UI/Speech sign on to the language change event and update themselves accordingly when it's fired.

Static Public Member Functions

static void Setup (string defaultLanguage)
 Called at startup. Sets up the default language. More...
 
static void LanguageChanged ()
 Tells all the OnLanguageChanged subscribers the language changed. Calling this directly is an alternative way of refreshing all elements. More...
 
static string Escape (string xml)
 Swaps e.g. < with > so the text won't get treated like xml/html. More...
 

Static Public Attributes

static string VariableModifiers =""
 A string appended onto the end of variable names for handling gender. More...
 
static WhitespaceMode Whitespace =WhitespaceMode.Normal
 The global whitespace mode. By default sequences of spaces will be collapsed into one. More...
 

Properties

static Gender Gender [get, set]
 Gets or sets the active gender. Internally fires the OnGenderChanged event. More...
 
static string Language [get, set]
 Gets or sets the code of the active language (e.g. "en"). Internally fires the OnLanguageChanged event. More...
 

Events

static LanguageChange OnLanguageChanged
 An event fired when the language is changed. More...
 
static TextModifierChange OnGenderChanged
 An event fired when the player gender changes. More...
 

Static Private Attributes

static string _Language ="en"
 The current language. See Wrench.Text.Language. More...
 
static Gender _Gender =Gender.Either
 The current gender. See Wrench.Text.Gender. More...
 

Member Function Documentation

static string Wrench.Text.Escape ( string  xml)
inlinestatic

Swaps e.g. < with > so the text won't get treated like xml/html.

Parameters
xmlThe xml to escape.
Returns
The escaped string.
static void Wrench.Text.LanguageChanged ( )
inlinestatic

Tells all the OnLanguageChanged subscribers the language changed. Calling this directly is an alternative way of refreshing all elements.

static void Wrench.Text.Setup ( string  defaultLanguage)
inlinestatic

Called at startup. Sets up the default language.

Parameters
defaultLanguageThe code for the default language, e.g. "en".

Member Data Documentation

Gender Wrench.Text._Gender =Gender.Either
staticprivate

The current gender. See Wrench.Text.Gender.

string Wrench.Text._Language ="en"
staticprivate

The current language. See Wrench.Text.Language.

string Wrench.Text.VariableModifiers =""
static

A string appended onto the end of variable names for handling gender.

WhitespaceMode Wrench.Text.Whitespace =WhitespaceMode.Normal
static

The global whitespace mode. By default sequences of spaces will be collapsed into one.

Property Documentation

Gender Wrench.Text.Gender
staticgetset

Gets or sets the active gender. Internally fires the OnGenderChanged event.

string Wrench.Text.Language
staticgetset

Gets or sets the code of the active language (e.g. "en"). Internally fires the OnLanguageChanged event.

Event Documentation

TextModifierChange Wrench.Text.OnGenderChanged
static

An event fired when the player gender changes.

LanguageChange Wrench.Text.OnLanguageChanged
static

An event fired when the language is changed.