0

i am developing an multilingual application. English and french are supported right now.

There is a form which creates an activity and it also supports search functionality for created Event. For example My Event name is "Event tour". and if i search it the same event is returned.

now my problem is if i change language of my application to french the event "Event Tour" is converted to "Visite de l'événement" . so now if i want to search for "event tour" the event tour is not returned. if i search for "eve" as in "événement" then also event is not returned.

but if i search for valid fields search works fine e.g. search for "Visite de" etc.

How can i do this search. as my keyboard doesnot support " é " character. What should be my strategy to handle such type of scenario. as it can happen for any other language that i will support in future also.

Learner
  • 1,277
  • 3
  • 15
  • 34
  • You may implement a search index. Something that puts together the english and french names and any other data to consider within the search. Depending on the languages you may consider or not to convert the "é" to "e". You should google for best practices for search indexing or even for a search engine itself – Alessandro Aug 12 '14 at 14:14

1 Answers1

0

I think this has probably been answered here but I'll re-iterate what's in there.

You should be able to force the comparison within a case-insensitive collation.

If you do a query like below (not sure of your schema)

SELECT *
FROM events
WHERE
event_name COLLATE Latin1_general_CI_AI Like '%eve%' COLLATE Latin1_general_CI_AI

Then événement will come back.

You won't be able to search for translations, however (as that isn't really a SQL issue) so the other thing you could do is keep a table of translations and lookup via that table.

Community
  • 1
  • 1
franglais
  • 928
  • 2
  • 15
  • 39