EasyTalk API
|
A TranslationSet contains lines of text which have been translated into a particular language. More...
Public Member Functions | |
Translation | AddOrFindTranslation (string text) |
Checks the translation set to see if the text provided is in the current list of translations. If it isn't, a new translation entry is added for the text. | |
void | ExpandToSize (int size) |
Adds new translations to the translation set until it reaches a certain size. | |
void | SetTranslation (int id, string text) |
Sets the translation at the specified source ID to the value provided. | |
Translation | GetTranslation (int id) |
Returns the Translation for the specified ID, if it exists. | |
bool | ContainsTranslation (string text) |
Returns whether the translation set contains a translation with the text specified. | |
Translation | FindTranslation (string text) |
Finds the Translation object attributed to the text specified, if it exists. | |
Static Public Member Functions | |
static string | RemoveAllTags (string text) |
Removes all node tags and TextMeshPro/HTML markup tags from the string provided. | |
static string | RemoveTMPTags (string text) |
Removes TextMeshPro/HTML markup tags from the string provided. | |
static string | RemoveNodeTags (string text) |
Removes all node tags from the string provided. | |
static string | IndexVariableNames (string text, Dictionary< string, string > variableNameMap) |
Replaces all variable references in the provided string with numeric, indexed variable names. The new variable names are stored as keys in the variableNameMap provided and the original variable names are stored as the respective values. | |
static string | ReplaceVariables (string text, Dictionary< string, string > variableNameMap) |
Replaces all variable references in the provided string with the respective variable names stored as values in the provided Dictionary. Each of the variable names referenced in the string must match a key in the variableNameMap in order to be replaced. | |
Public Attributes | |
string | languageCode |
The ISO-639 language code for the translation set. | |
List< Translation > | translations = new List<Translation>() |
A List of translated liens for the translation set. | |
Private Member Functions | |
Translation | TryAddTranslation (int id, string text) |
Attempts to add a new translation for the specified translation ID. | |
Private Attributes | |
int | counter = 0 |
The current counter of the translation set. | |
bool | preventTagInclusion = true |
Whether node tags and TextMeshPro/HTML markup tags should be removed from text prior to putting it into the list of translated lines. | |
A TranslationSet contains lines of text which have been translated into a particular language.
Translation EasyTalk.Localization.TranslationSet.AddOrFindTranslation | ( | string | text | ) |
Checks the translation set to see if the text provided is in the current list of translations. If it isn't, a new translation entry is added for the text.
text | The text to find/add a translation for. |
bool EasyTalk.Localization.TranslationSet.ContainsTranslation | ( | string | text | ) |
Returns whether the translation set contains a translation with the text specified.
text | The translation text to check. |
void EasyTalk.Localization.TranslationSet.ExpandToSize | ( | int | size | ) |
Adds new translations to the translation set until it reaches a certain size.
size | The size which the translation set should be set to. |
Translation EasyTalk.Localization.TranslationSet.FindTranslation | ( | string | text | ) |
Finds the Translation object attributed to the text specified, if it exists.
text | The text to find a Translation object for. |
Translation EasyTalk.Localization.TranslationSet.GetTranslation | ( | int | id | ) |
Returns the Translation for the specified ID, if it exists.
id | The ID of the Translation to retrieve. |
|
static |
Replaces all variable references in the provided string with numeric, indexed variable names. The new variable names are stored as keys in the variableNameMap provided and the original variable names are stored as the respective values.
text | The text to index variable references on. |
variableNameMap | A Dictionary to insert mappings of indexed variable names to old variable names into. |
|
static |
Removes all node tags and TextMeshPro/HTML markup tags from the string provided.
text | The string to remove tags from. |
|
static |
Removes all node tags from the string provided.
text | The string to remove tags from. |
|
static |
Removes TextMeshPro/HTML markup tags from the string provided.
text | The string to remove tags from. |
|
static |
Replaces all variable references in the provided string with the respective variable names stored as values in the provided Dictionary. Each of the variable names referenced in the string must match a key in the variableNameMap in order to be replaced.
text | The string to replace variable names in. |
variableNameMap | A Dictionary with current variable names as keys and replacement variable names as values. |
void EasyTalk.Localization.TranslationSet.SetTranslation | ( | int | id, |
string | text ) |
Sets the translation at the specified source ID to the value provided.
id | The source ID the translation applies to. |
text | The translated text to set. |
|
private |
Attempts to add a new translation for the specified translation ID.
id | The source ID the translation applies to. |
text | The translated text. |
|
private |
The current counter of the translation set.
string EasyTalk.Localization.TranslationSet.languageCode |
The ISO-639 language code for the translation set.
|
private |
Whether node tags and TextMeshPro/HTML markup tags should be removed from text prior to putting it into the list of translated lines.
List<Translation> EasyTalk.Localization.TranslationSet.translations = new List<Translation>() |
A List of translated liens for the translation set.