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 Dom.Text.Language. More...
 
static Gender _Gender =Gender.Either
 The current gender. See Dom.Text.Gender. More...
 

Member Function Documentation

static string Dom.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 Dom.Text.LanguageChanged ( )
inlinestatic

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

static void Dom.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 Dom.Text._Gender =Gender.Either
staticprivate

The current gender. See Dom.Text.Gender.

string Dom.Text._Language ="en"
staticprivate

The current language. See Dom.Text.Language.

string Dom.Text.VariableModifiers =""
static

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

WhitespaceMode Dom.Text.Whitespace =WhitespaceMode.Normal
static

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

Property Documentation

Gender Dom.Text.Gender
staticgetset

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

string Dom.Text.Language
staticgetset

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

Event Documentation

TextModifierChange Dom.Text.OnGenderChanged
static

An event fired when the player gender changes.

LanguageChange Dom.Text.OnLanguageChanged
static

An event fired when the language is changed.