A set of variables for a particular language. Used for localization.
Public Member Functions | |
LanguageSet () | |
Creates a new empty language set. More... | |
LanguageSet (string content, LanguageLoader loader) | |
Creates a new language set, loading its content from the given xml string. More... | |
LanguageSet (string content) | |
Creates a new language set, loading its content from the given xml string. More... | |
LanguageSet (string content, string group) | |
Creates a new language set, loading its content from the given xml string. More... | |
void | SetContent (string content) |
Sets the content of this language from a given xml string. More... | |
bool | ContainsGroup (string group) |
Does this set contain the named group? More... | |
LanguageSet | LoadGroup (string groupName) |
Loads the group with the given name using this sets loader, if there is one. More... | |
LanguageSet | AddGroup (string content) |
Adds the group from the given text. This allows loading new language variables at runtime. More... | |
LanguageSet | AddGroup (string content, string group) |
Adds the group from the given text. This allows loading new language variables at runtime. More... | |
void | AddGroup (LanguageSet group) |
Adds the given group to this set. This allows loading new language variables at runtime. More... | |
void | RemoveGroup (string group) |
Removes a group from this language. More... | |
override string | GetValue (string code) |
Gets the value of the named variable from this set. More... | |
Public Member Functions inherited from Wrench.VariableSet | |
VariableSet () | |
Creates a new empty variable set. More... | |
void | Clear () |
Empties this variable set. More... | |
void | Add (string code, string value) |
Adds a variable to this set. More... | |
void | Remove (string code) |
Removes a variable by name. More... | |
bool | Contains (string code) |
Checks if this variable set contains the named variable. More... | |
virtual void | SetValue (string code, string value) |
Sets a value of the named variable into this set. Creates it if it doesn't exist. More... | |
Public Attributes | |
string | Name |
The name of the language. More... | |
string | Code |
The language code, e.g. "en". Always lowercase. More... | |
string | Group |
A group, if any. This will either come from the language tag or be provided in a constructor. It gets appended to all variable names in the set and defines a set of variables, such as all those found on the login page. Grouped variables let you break it down into multiple files. They are accessed with &groupname.varname; More... | |
bool | GoesLeftwards |
True if this language goes from right to left (e.g. arabic). More... | |
LanguageLoader | Loader |
The language loader (if any) used to load this set. More... | |
GroupResolve | OnGroupResolve |
A delegate called when a group gets resolved from a variable but isn't found in ExtraGroups. More... | |
Dictionary< string, LanguageSet > | ExtraGroups |
A set of additional groups. More... | |
Public Attributes inherited from Wrench.VariableSet | |
Dictionary< string, string > | Map |
The lookup of variable name to its content. More... | |
Additional Inherited Members | |
Properties inherited from Wrench.VariableSet | |
string | this[string code] [get, set] |
Gets or sets (or creates if not found) the value of a named variable in this set. More... | |
|
inline |
Creates a new empty language set.
|
inline |
Creates a new language set, loading its content from the given xml string.
content | An xml formatted string of all the variables in this language. |
loader | The optional loader which loaded this set. |
group | A group that these language variables belong to. |
|
inline |
Creates a new language set, loading its content from the given xml string.
content | An xml formatted string of all the variables in this language. |
group | A group that these language variables belong to. |
|
inline |
Creates a new language set, loading its content from the given xml string.
content | An xml formatted string of all the variables in this language. |
group | A group that these language variables belong to. |
|
inline |
Adds the group from the given text. This allows loading new language variables at runtime.
content | The xml structured variables. |
|
inline |
Adds the group from the given text. This allows loading new language variables at runtime.
content | The xml structured variables. |
group | The name of the group. |
|
inline |
Adds the given group to this set. This allows loading new language variables at runtime.
group | The group to add. |
|
inline |
Does this set contain the named group?
|
inlinevirtual |
Gets the value of the named variable from this set.
code | The name of the variable to get the value of. |
Reimplemented from Wrench.VariableSet.
|
inline |
Loads the group with the given name using this sets loader, if there is one.
|
inline |
Removes a group from this language.
group | The name of the group to remove. |
|
inline |
Sets the content of this language from a given xml string.
content | An xml formatted string of all the variables in this language. |
string Wrench.LanguageSet.Code |
The language code, e.g. "en". Always lowercase.
Dictionary<string,LanguageSet> Wrench.LanguageSet.ExtraGroups |
A set of additional groups.
bool Wrench.LanguageSet.GoesLeftwards |
True if this language goes from right to left (e.g. arabic).
string Wrench.LanguageSet.Group |
A group, if any. This will either come from the language tag or be provided in a constructor. It gets appended to all variable names in the set and defines a set of variables, such as all those found on the login page. Grouped variables let you break it down into multiple files. They are accessed with &groupname.varname;
LanguageLoader Wrench.LanguageSet.Loader |
The language loader (if any) used to load this set.
string Wrench.LanguageSet.Name |
The name of the language.
GroupResolve Wrench.LanguageSet.OnGroupResolve |
A delegate called when a group gets resolved from a variable but isn't found in ExtraGroups.