CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Searching for contacts with non-English names
Pages: [1]

Author Topic: Searching for contacts with non-English names  (Read 1378 times)

eggtart

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
Searching for contacts with non-English names
March 27, 2010, 09:22:35 pm
When registering a new member, I need to enter a contact's name in the "Select Contact" field.  That field has some javascript attached to it such that it will try to locate a contact with every key press.  This works fine when the contact's name is in English.  But if the name is in, say, Chinese, the search will fail, and I can't find any other way to enter the contact's name.

This can be a problem cos a lot of fields are using this kind of searching mechanism.  E.g. when defining a relationship.

Thanks
« Last Edit: March 29, 2010, 03:17:50 am by eggtart »

eggtart

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
Re: Searching for contacts with non-English names
March 28, 2010, 08:23:28 am
One possible reason is that the js function was called at the wrong word boundary for double byte characters.  One way to get around this is to append a "%" to the end of the search string.

Cheers

Michał Mach

  • Moderator
  • Ask me questions
  • *****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Searching for contacts with non-English names
March 29, 2010, 07:28:28 am
Can you file an issue with detailed description on how to reproduce it and example data (issues.civicrm.org)? Seems like we should take a closer look at it, most probably in 3.3. If you provide a patch, that might help including the fix in earlier version.

Thanks,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

eggtart

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
Re: Searching for contacts with non-English names
March 30, 2010, 07:52:31 pm
My solution to this is
a) Ask the users to enter an extra space after the search term, e.g. "陳大 ".  This is to force the js to perform the ajax search.
b) Change AJAX.php to strip off the trailing space.

I think doing b) probably would not hurt other languages.  So this can be a quick fix for the next release.

I have also changed sort_name to display_name in AJAX.php.  This is more appropriate for Chinese name display.

Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Searching for contacts with non-English names

This forum was archived on 2017-11-26.