Reputation: 469
I am working on a website which will have an option for Thai language. How do I add Thai langauge to a website? I tested this by translating some random words via Google Translate from English into Thai language and then just copy pasted Thai text into my html document. It worked and showed Thai text correctly but is this a right way to do it???
Should I change lang="en" into lang="th" or should I leave it like it is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<head>
<body>
</body>
</html>
And what about charset? Is there another charset for Thai language???
Also, I see Google Fonts offer 2 versions of Thai fonts but they are not very readable according to me. Are there other Thai fonts that I can use and add them to my website???
Sorry for basic question but I never encountered such a problem so far... Thanks all!
Upvotes: 1
Views: 3782
Reputation: 1
I use the following to display the first character in the thai alphabet:
<html><head></head><body><p>ก</p></body></html>
which at least in my browser shows ko kai (letter 1 in the thai alphabet). Then one can just look up all thai characters in the UTF-8 character set.
I guess this is the general way of using odd utf-8 characters in any html script. Of course this is a roundabout way for large texts but seems to work.
Upvotes: 0
Reputation: 943100
Should I change lang="en" into lang="th" or should I leave it like it is
The lang
attribute describes the language the document is written in. If you are writing in Thai, you should not claim you are writing in English.
How do I add Thai langauge to a website?
Just type it.
And what about charset? Is there another charset for Thai language?
There are plenty of character encodings out there. Different ones support different sets of characters. UTF-8 supports all the characters you need for just about every language out there and is a good default choice.
You might get better performance out of TIS-620 but note that you'll need to actually save the file as TIS-620. Just telling the browser you are using it will not work.
How to use Thai web font on a website?
The same way you use any other web font.
Upvotes: 3
Reputation: 174937
A font is nothing more than a definition of how to draw shapes on the screen based on the character code of a given character.
You use a Thai webfont just like you use any other webfont. And most browsers will have a default font for Thai that can be used assuming the operating system and the browser supports it.
Upvotes: 1