Page 1 of 1
multi language problem..
Posted: Mon May 24, 2010 11:50 pm
by pba
what i need is to use 2 different char set in a form..
some fields in the form r needed to be filled in nepali language and some in english. i am using utf-8, cakephp.
previously i was using
textarea {font-family:nepali} in css. now i want to migrate to utf-8..
Re: multi language problem..
Posted: Tue May 25, 2010 1:54 am
by Apollo
pba wrote:2 different char set in a form..
No can do. Just use UTF-8, it contains both English and Nepali characters (and any other language for that matter, including Klingon).
Include the [text]<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>[/text] header in yout HTML and you should be fine.
Re: multi language problem..
Posted: Tue May 25, 2010 3:35 am
by pba
thanks Applo...but my problem is.. i need to restrict users to input in a particular language. at present users can input in any language as their wish.
example:- a input field meant to be filled in nepali language can be filled in nepali or any other language.
what i need:- a input field meant to be filled in nepali can not be filled in any other language....
Re: multi language problem..
Posted: Tue May 25, 2010 5:14 am
by Apollo
How would you detect if some text is in a particular language or not?
For example, wluod you cnsoider tihs a viald Elginsh secnente?
You could take the entered text apart character by character, and for each character verify if they're in the language's unicode range. This might work for languages that use characers unique for that language alone (such as Klingon, and Nepali too I guess, although I dunno of there exist some Birmese or Bhutanese dialect or native language of inner Mongolia which uses the same character set). Won't work for languages sharing the same alphabet, such as most western languages.
Another possibility would be dictionary heuristics, which seem quite an overkill for a simple restriction like this.
Re: multi language problem..
Posted: Tue May 25, 2010 8:09 am
by Weirdan
Apollo wrote:This might work for languages that use characers unique for that language alone (such as Klingon, and Nepali too I guess, although I dunno of there exist some Birmese or Bhutanese dialect or native language of inner Mongolia which uses the same character set).
Nepali is usually written in Devanagari, which is also used for other Indic languages.