Welcome, Guest
Username: Password: Remember me

TOPIC: Localize name by part of the key

Localize name by part of the key 1 week 4 days ago #3253

  • Killersan
  • Killersan's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
Hello,

We got a bit more complex use case.
We are finalizing Auction House for our framework and there is a search box in it, so we would like to search item by its selected language key value, or part of the value. For example, when someone will put the sword in the search input field, we would like to search all key values for the language which contain %sword% value in the specific category and return the original keys, so we could search it in the main database at the end.

Is it already possible and if so, how we can achieve it?
Last Edit: 1 week 4 days ago by Killersan.
The administrator has disabled public write access.

Localize name by part of the key 1 week 4 days ago #3254

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1129
  • Thank you received: 241
  • Karma: 70
Hi,
You can use the LocalizationManager.GetTermsList( categoryName ) to get the list of all terms belonging to that category. Then, it's just filtering to all those that contain the given word.
            string category = "Weapons";
            string filter = "sword";
            var termNames = LocalizationManager.GetTermsList(category).Where(x => x.Contains(filter)).ToList();

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.594 seconds
Colors