We help IT Professionals succeed at work.

How to create a website in Indian languange (Gujarati, Hindi) other than english?

Avinash Zala
Avinash Zala asked
on
Hi Es,

I want to create a simple website but not in English its in Indian language (Gujarati).

I don't want to force the user to download the fonts to their own system.

I have ttf file of gujarati fonts.

Can you please suggest how can i achieve this?

I am going to build this website in php....

Thanks
Addy
Comment
Watch Question

Commented:
well, UTF-8 have support for indian languages and at least in firefox gujarati displays without problems and without downloading any other files. Look at: http://gujaratsamachar.com/beta/
Display your pages as UTF-8 :

set the php header to utf8
use the html meta-tag "content type" and set it as utf8
store your php scripts and html pages as utf8 without bom

You can't do anything with these ttf files, if user has not that specific ttf file, he will have to download it first ...
Avinash ZalaWeb Expert

Author

Commented:
Can u pl provide one demo file for this?
Commented:
Hi AddyWatson,
You can use the style sheet and follow the sample code I have included. Just replace th font name with yours and make sure that you point to the proper location of the font on your server. Yes, you will need to host the font as well along with the other files on your website. Then you should be done. Just replace "Your Custom font" name with your font name.

Hope that helps.
<style type="text/css">
@font-face {
    font-family: "Your Custom font";
    src: url(http://www.yourdomain.com/yourcustomfont.ttf) format("truetype");
}
.title { 
	/*Use the other fonts for fallback in case your font is not included for some reason*/
    font-family: "Your Custom font", Arial, Geneva, Times New Roman;
}
</style>

<h1 class="title">Kem cho amigos!</h1>

Open in new window

Avinash ZalaWeb Expert

Author

Commented:
thanks for your helps.
I will use this and get back to you.

I have one more problem..


when i copy Gujarati text from doc file and paste into my HTML form then its get converted to normal English sentence.

What will be the solution for this?

Can you please suggest. For more info check this question.
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Word/Q_26255897.html

Thanks again.
Addy

Commented:
Hi Addy,
I believe the second problem that you mentioned is different from the problem that you have indicated in your question above. Just so that we can track and keep a tab on the progress of these issues separately, I am going to post any possible solutions for your next problem in it's corresponding thread.

You may try the code that I posted for your website and post the results here. I will use your other thread to post responses for your other problem.
I suggest use unicode for gujurati . Use google translator tool to create the text , dont use font on ur website. Its pretty simple to use google translator tool to type in gujurati text.
Avinash ZalaWeb Expert

Author

Commented:
@contactrobol:

Can you post any example for the use of google translator in PHP..

It will be very helpful for me.

Thanks
Addy
¿¿¿¿  ¿  ¿¿¿¿¿  ¿¿  ¿¿¿¿¿¿¿¿    http://www.google.com/transliterate/gujarati and soft to download http://www.google.com/ime/transliteration
Avinash ZalaWeb Expert

Author

Commented:
ya this one is nice.

But my problem is that some one copy from the word file and paste into the text area which i have created then its not working.i its not pasting proper Gujarati in text area. its just converted to normal English sentence.

hope you understand my problem.

Thanks
Addy
http://www.microsoft.com/typography/weft.mspx  The Web Embedding Fonts Tool (WEFT) lets Web authors create 'font objects' that are linked to their Web pages so when viewed through the browser, pages are displayed in the style contained in the font object.
Avinash ZalaWeb Expert

Author

Commented:
@mepro


Its not working...

Commented:
Hi Addy,
Can you tell me what exactly is not working? Is it not showing the text like you have wanted or something else? Also did you remember to upload the font to your website? If not, it won't work. You will have to make sure that there are no spaces in the font name otherwise results could be undesirable.

So if you can state it's symptoms, it would help me to help you.
Avinash ZalaWeb Expert

Author

Commented:
its a problem with my fonts, which not working in FF, but its working on other browser.....

With this method, can i write some English and Gujarati letters in a same text area?????

Commented:
By text area, do you mean text area in a form? You may be able to write it but whether it's going to display it or not depends again on the method that I have indicated above. You have to make sure that font exists. If not, then some browsers can trouble you.

Also it depends upon how you are trying to include Gujarati text in the form. Some editors strip off the weird characters, so if they don't recognize your text, then you don't see them when you paste them in the text area.

Also if you are trying to store the text in Gujarati in your database, then you will have to go over unicode & encoding practices. Look it up in Google to see if you can find something interesting because that is a vast subject to deal with.
Avinash ZalaWeb Expert

Author

Commented:
that works, but With this i have problem with writing Gujarati as well as English in same text area, any idea about that.  I think utf-8 will be helpful for this. What you think?

Commented:
I think you should try encoding according to the UTF-8 & see if that helps you. It would help us to know how you are including the Gujarati text. Are you copying it from somewhere & pasting into a WYSIWYG editor? What exactly are you doing?