Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ગુજરાતી language in C#

Tags:

c#

I am creating a "Gujarati To English Dictionary" application using C#.

In which I would want that if user types "tajmhal" from the keyboard "તાજમહાલ" would be displayed in the TEXTBOX at the same time.

ie. If "koml" , "કોમલ" is displayed. etc...

I have downloaded and set the font for the textbox to "Gujarati Saral-1" and it works.

But when I store the text of the textbox to the database it is stored as "tajmhal" not "તાજમહાલ".

so, could you please suggest to me another solution?

like image 900
aarti Avatar asked Sep 13 '11 04:09

aarti


3 Answers

From what I call tell after looking at this font info page this font is NOT a Unicode font, but rather displays Latin code-points as Gujarati glyphs.

In order to make your idea work, you need to use a Gujarati Unicode-compliant font, and replace each Latin character with its equivalent character. See this table for the Gujarati code-points.

like image 53
devio Avatar answered Nov 15 '22 12:11

devio


If the user types tajmhal from the keyboard, then that will be saved in the database. You can show it using whatever font you like - a nice Indian font, fancy calligraphy font, comic sans, barcode, wingdings - but it is still tajmhal.

You need to translate the word or characters from one language to another. That's not a font issue, that requires some mapping from one to the other. The characters will have different unicode values - you can try mapping them yourself, character by character, but this is unlikely to work unless the two languages have the same number of letters and they map directly from one to another. So you need to translate.

The other answer suggests using Google. You're writing a desktop application but you can still integrate with Google technology; if network is down then you don't translate and try again later.

Question: if the text is displaying as you want then why do you need to translate it? You're obviously using an english keyboard - why not store the text as english characters?

like image 38
Kirk Broadhurst Avatar answered Nov 15 '22 12:11

Kirk Broadhurst


Google has a transliteration api (that is unfortunately deprecated), which might solve your problem. If you need there are other services like Quillpad that you might want to buy. These will allow you to type in one script and get the phonetic equivalent in another script - transliteration. Once you store your data in the database, you should be able to display it again, unless you're storing the English string there by mistake.

like image 23
Roshan Mathews Avatar answered Nov 15 '22 11:11

Roshan Mathews