Welcome, Guest
Username: Password: Remember me

TOPIC: Using I2 Localization as a database.

Using I2 Localization as a database. 2 years 2 months ago #1982

  • robo99
  • robo99's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
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 2 months ago by robo99.
The administrator has disabled public write access.

Using I2 Localization as a database. 2 years 2 months ago #1985

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1202
  • Thank you received: 256
  • Karma: 78
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 1 month ago by Frank.
The administrator has disabled public write access.
The following user(s) said Thank You: robo99

Using I2 Localization as a database. 2 years 1 month ago #1997

  • robo99
  • robo99's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
Thanks, Frank! :cheer:
The administrator has disabled public write access.

Using I2 Localization as a database. 2 months 3 weeks ago #3394

  • robo99
  • robo99's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
I just updated and "LanguageSource.GetCategoryFromFullTerm()" is now gone... What to do?
The administrator has disabled public write access.

Using I2 Localization as a database. 2 months 3 weeks ago #3395

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1202
  • Thank you received: 256
  • Karma: 78
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
The administrator has disabled public write access.
Time to create page: 0.095 seconds
Template by JoomlaShine