EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Localization.TranslationLibrary Class Reference

Provides a collection of translations of text for various languages. More...

Inherits ScriptableObject.

Public Member Functions

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< TranslationGetUntranslatedLines (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.
 

Public Attributes

string originalLanguage = "en"
 The original/default language for the translation library.
 
List< TranslationSettranslationSets = new List<TranslationSet>()
 A list of TranslationSets, each containing translations for a specific language.
 

Detailed Description

Provides a collection of translations of text for various languages.

Member Function Documentation

◆ 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
languageCodeThe 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
languageCodeThe 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
lineThe line to translate.
targetLanguageCodeThe 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
languageCodeThe 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
languageCodeThe 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
languageCodeThe ISO-639 language code to change to.

Member Data Documentation

◆ originalLanguage

string EasyTalk.Localization.TranslationLibrary.originalLanguage = "en"

The original/default language for the translation library.

◆ translationSets

List<TranslationSet> EasyTalk.Localization.TranslationLibrary.translationSets = new List<TranslationSet>()

A list of TranslationSets, each containing translations for a specific language.