Provides a collection of translations of text for various languages.
More...
Inherits ScriptableObject.
|
Translation | GetTranslation (string line, string targetLanguageCode) |
| Returns the translation for the specified line of text and ISO-639 language code, if it exists.
|
|
TranslationSet | GetOrCreateOriginalTranslationSet () |
| Retrieves or creates a translation set for the default/original language of the library.
|
|
bool | HasTranslationSet (string languageCode) |
| Returns true if the library contains a TranslationSet for the ISO-639 language code provided.
|
|
TranslationSet | AddSecondaryTranslationSet (string languageCode) |
| Add a TranslationSet for the ISO-639 language code specified if it doesn't exist in the library.
|
|
TranslationSet | FindTranslationSetForLanguage (string languageCode) |
| Finds and returns the TranslationSet for the specified ISO-639 language code.
|
|
List< Translation > | GetUntranslatedLines (string languageCode) |
| Returns a List of untranslated Translations (lines) for the specified ISO-639 language code. Any empty entries in the found TranslationSet are assumed to be untranslated.
|
|
void | SetOriginalLanguage (string languageCode) |
| Changes the original language of the library to the specified ISO-639 language code and adds a TranslationSet for it if one doesn't exist for that language.
|
|
Provides a collection of translations of text for various languages.
◆ AddSecondaryTranslationSet()
TranslationSet EasyTalk.Localization.TranslationLibrary.AddSecondaryTranslationSet |
( |
string | languageCode | ) |
|
Add a TranslationSet for the ISO-639 language code specified if it doesn't exist in the library.
- Parameters
-
languageCode | The ISO-639 language code to add a TranslationSet for. |
- Returns
- The TranslationSet for the language code specified.
◆ FindTranslationSetForLanguage()
TranslationSet EasyTalk.Localization.TranslationLibrary.FindTranslationSetForLanguage |
( |
string | languageCode | ) |
|
Finds and returns the TranslationSet for the specified ISO-639 language code.
- Parameters
-
languageCode | The ISO-639 language code to find a TranslationSet for. |
- Returns
- The TranslationSet for the specified language, if it exists; null otherwise.
◆ GetOrCreateOriginalTranslationSet()
TranslationSet EasyTalk.Localization.TranslationLibrary.GetOrCreateOriginalTranslationSet |
( |
| ) |
|
Retrieves or creates a translation set for the default/original language of the library.
- Returns
- A TranslationSet for the default/original language of the library.
◆ GetTranslation()
Translation EasyTalk.Localization.TranslationLibrary.GetTranslation |
( |
string | line, |
|
|
string | targetLanguageCode ) |
Returns the translation for the specified line of text and ISO-639 language code, if it exists.
- Parameters
-
line | The line to translate. |
targetLanguageCode | The ISO-639 language code to translate to. |
- Returns
- The translated line, if found; otherwise null.
◆ GetUntranslatedLines()
List< Translation > EasyTalk.Localization.TranslationLibrary.GetUntranslatedLines |
( |
string | languageCode | ) |
|
Returns a List of untranslated Translations (lines) for the specified ISO-639 language code. Any empty entries in the found TranslationSet are assumed to be untranslated.
- Parameters
-
languageCode | The ISO-639 language code of the TranslationSet to get untranslated lines for. |
- Returns
- A List of untranslated lines for the language code specified.
◆ HasTranslationSet()
bool EasyTalk.Localization.TranslationLibrary.HasTranslationSet |
( |
string | languageCode | ) |
|
Returns true if the library contains a TranslationSet for the ISO-639 language code provided.
- Parameters
-
languageCode | The ISO-639 language code to check for a translation set. |
- Returns
- True if a TranslationSet is found for the specified ISO-639 language code.
◆ SetOriginalLanguage()
void EasyTalk.Localization.TranslationLibrary.SetOriginalLanguage |
( |
string | languageCode | ) |
|
Changes the original language of the library to the specified ISO-639 language code and adds a TranslationSet for it if one doesn't exist for that language.
- Parameters
-
languageCode | The ISO-639 language code to change to. |
◆ originalLanguage
string EasyTalk.Localization.TranslationLibrary.originalLanguage = "en" |
The original/default language for the translation library.
◆ translationSets
A list of TranslationSets, each containing translations for a specific language.