Localize name by part of the key

More
5 years 5 months ago - 5 years 5 months ago #3253 by Killersan
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: 5 years 5 months ago by Killersan.

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

More
5 years 5 months ago #3254 by Frank
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

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

Time to create page: 0.629 seconds
Template by JoomlaShine