Skip to content

Instantly share code, notes, and snippets.

@leafduo
Created June 20, 2013 18:39
Show Gist options
  • Select an option

  • Save leafduo/5825399 to your computer and use it in GitHub Desktop.

Select an option

Save leafduo/5825399 to your computer and use it in GitHub Desktop.

I guess I know what’s going on after a few trials. Toshl puts a validation rule which requires the name has at least 4 characters. Unfortunately, almost all Chinese have a name of 2 or 3 characters, like “张三”, which is not allowed in Toshl… (I guess some Japanese would suffer the same problem)

As an iOS developer, I also want to propose some suggestions:

  • Abandon the validation at all
  • Detect the language in use by using CFStringTokenizerCopyBestStringLanguage or some regular expression (don't preform validation on non-western names)
  • Detect the locale of the device by using NSLocale (not suggested because some Chinese are using non-Chinese locale)
  • Make the notice clearer by saying "your name is not long enough" instead of "please enter your name"
  • Read some articles about Chinese names…

Though not tested, I believe the problem could be solved pretty easily. Good luck and get more Chinese users!

@mihahribar
Copy link
Copy Markdown

Thanks a lot! You just saved us a lot o time. How can we get more users like you? :)

We opted not to do any validation (user just has to write at least something in the field to get through).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment