Difference between revisions of "LocalizedString class"
Nguyenduyan (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=<nowiki>LocalizedString</nowiki> |Description=<nowiki>Represents translation of a string.</nowiki> |Constructors= {{CGscriptConstructors_Templat...") |
|||
Line 4: | Line 4: | ||
|Constructors= | |Constructors= | ||
{{CGscriptConstructors_Template|Description=<nowiki>Create a new translatable text</nowiki>}} | {{CGscriptConstructors_Template|Description=<nowiki>Create a new translatable text</nowiki>}} | ||
+ | {{CGscriptConstructors_Template|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>dictionary</nowiki>|Description=<nowiki>Dictionary with existing values</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>defaultIsocode</nowiki>|Description=<nowiki>If given use this isocodes value in the dictionary as the default</nowiki>}} | ||
+ | |Description=<nowiki>Create a new translatable text based on existing dictionary</nowiki>}} | ||
|Methods= | |Methods= | ||
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetSpecificTranslation</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetSpecificTranslation</nowiki>|Parameters= |
Revision as of 04:46, 13 July 2018
LocalizedString
Represents translation of a string.
Constructors
- () - Create a new translatable text
- (Dictionary dictionary "Dictionary with existing values", string defaultIsocode "If given use this isocodes value in the dictionary as the default") - Create a new translatable text based on existing dictionary
Methods
- string GetSpecificTranslation(string isocode "Isocode for language. Use empty for default text") - Get the translation for given isocode or null
- string GetTranslation(string isocode "Isocode for language. Use empty for default text") - Get the best matching translation for given isocode
- string GetTranslationForLoggedInUser() - Get the best matching translation for the current user
- bool RemoveTranslation(string isocode "Isocode for language. Use empty for default text") - Remove a specific translation
- Empty SetTranslation(string isocode "Isocode for language. Use empty for default text", string s "New translation") - Set a specific translation
- string ToString() - The string representation of the object.
Properties
- string ObjectTypeName { get; } - The name of the type of object.
- TypeInformation TypeInformation { get; } - Get information about this class.