Using I2 Localization as a database.

More
2 years 6 months ago - 2 years 6 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: 2 years 6 months ago by robo99.

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

More
2 years 6 months ago - 2 years 5 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: 2 years 5 months ago by Frank.
The following user(s) said Thank You: robo99

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

More
2 years 5 months ago #1997 by robo99
Thanks, Frank! :cheer:

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

More
6 months 3 weeks 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
6 months 3 weeks 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.149 seconds
Template by JoomlaShine