InformationModel.AddTranslation(localizedText, localizationDictionary)

Adds a new key in the project LocalizationDictionary, which name corresponds to the value of the TextId property of the first argument.

If the first argument also contains the LocaleId and Text properties, it also adds the translated string. The second argument is optional and indicates the LocalizationDictionary to which the key is added.
Important: You must specify the second argument if the project contains more than one LocalizationDictionary.
void AddTranslation(LocalizedText localizedText, IUAVariable localizationDictionary);

Arguments

localizedText (LocalizedText)
A C# object with properties that identify the key and any translated string to add.
localizationDictionary (IUAVariable)
A C# object that represents a LocalizationDictionary.

Example

The following example shows an API that adds a NewKey key and a New translation string for the en-US locale.

var myLocalizedText = new LocalizedText("NewKey", "New translation", "en-US");
InformationModel.AddTranslation(myLocalizedText);