views:

74

answers:

3

HI there,

i am localizing my application. i have some REG EX(for english) expression for client side validation.if i want to localize for non-english ,what is the best approach should i have REG-Ex for all languages chosen for localization

comments\suggestions appreciated.

Thanks DEE

+1  A: 

Having separate regular expressions for different language inputs stored in external resource files would be the best route. If you are doing .Net development, you can use resource files. If you are doing Java, you can use property files.

Derek Greer
A: 

Depends on what you're validating with your regexps. I'll assume you're doing some very basing natural language processing (may the giant spaghetti monster help you if so.)

Obviously, if some parts of your regexps are english-dependant (like, full english words), you will need to write the corresponding regexps in the other language (translating the english word by word might not be enough, since you might be capturing some grammar in your regexp).

An example of your regexps might help.

phtrivier
A: 

Can you post some examples? As Derek mentioned, separate regexes/files for each language is probably a must-have, but hard to tell without looking at what you are doing...

NinjaCat