Using I2 Localization as a database.

More
7 years 11 months ago - 7 years 11 months ago #1982 by robo99
Is it possible to get the amount of TERMS for a given category?

I'm make a name generator where I want the names to be localized.
Last edit: 7 years 11 months ago by robo99.

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

More
7 years 11 months ago - 7 years 11 months ago #1985 by Frank
Hi,

You can get the list of ALL terms using
string[] terms = LocalizationManager.GetTermsList();

Also, you can find what category a term has by using
string category = LanguageSource.GetCategoryFromFullTerm( Term );

And to get a list of all terms in a category, you can either iterate and add to a list, or for short using Linq:
using System.Linq;

string Category = "example";
string[] terms = LocalizationManager.GetTermsList().Where(x => (LanguageSource.GetCategoryFromFullTerm(x) == Category)).ToArray();

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
Last edit: 7 years 11 months ago by Frank.
The following user(s) said Thank You: robo99

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

More
7 years 10 months ago #1997 by robo99
Thanks, Frank! :cheer:

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

More
5 years 11 months ago #3394 by robo99
I just updated and "LanguageSource.GetCategoryFromFullTerm()" is now gone... What to do?

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

More
5 years 11 months ago #3395 by Frank
Because of the recent changes to the Unity Prefabs, all the functionality of the LanguageSource moved into LanguageSourceData

So, you should use:
LanguageSourceData.GetCategoryFromFullTerm(...)

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.

Time to create page: 0.146 seconds
Template by JoomlaShine