Create terms from script

More
4 years 8 months ago #3908 by sewerhrehorowicz
Hello,

How can I create terms from c#?

thanks in advance

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #3909 by Frank
Replied by Frank on topic Create terms from script
Here are a few links that explains in more detail how to add terms:
inter-illusion.com/forum/i2-localization...s-via-a-scripts#2799
inter-illusion.com/forum/i2-localization...m-editor-script#3296

Basically, you just find the LocalizationSource and use the AddTerm(xx). And then call UpdateDictionary to update the cache.
    TermData termData = LocalizationManager.Sources[0].AddTerm("My New Term");
    termData.Languages[0] = "This is an Example";
    termData.Languages[1] = "Esto es un ejemplo";

     // after adding al the terms
     LocalizationManager.Sources[0].UpdateDictionary();

LocalizationManager.Sources[0] its the I2Languages.prefab

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #3913 by sewerhrehorowicz
In Editor, this will cause out of range exception, and first you need to call this:
LocalizationManager.InitializeIfNeeded();
Then it will work.

Guys please fix website. Submit button is cut off, there is no scrollbar and I have to hack styles in developer console to reply.

Please Log in or Create an account to join the conversation.

Time to create page: 0.195 seconds
Template by JoomlaShine