Welcome, Guest
Username: Password: Remember me

TOPIC: Using I2 Localization as a database.

Using I2 Localization as a database. 2 years 6 days 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 6 days ago by robo99.
The administrator has disabled public write access.

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

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1169
  • Thank you received: 253
  • Karma: 77
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 19 hours 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 6 hours 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. 3 weeks 6 days 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. 3 weeks 6 days ago #3395

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1169
  • Thank you received: 253
  • Karma: 77
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.128 seconds
Template by JoomlaShine