I have a site in english, and i need the option to display it in other languages. The first language to display it in is Korean
Anyone know where to begin on this? I was going to use session variables to set the language option, then use a database to fetch the content. is there a better way?
p.s. i hate clients. 14 f-cking hours i’ve been at work today
If you have elements in your design you want to change, such as navigation, I’ll just create a new file for each language with common variable names but with the values in different languages then load whichever file depending on their choice.
If you’re going to have a lot of different languages, you should look into gettext. You would still need to have translations for every bit of text, but you wouldn’t need to replicate every file.
You might also be able to use the Accept-Language HTTP header to determine what language to use.
I don’t know how the RTL <-> LTR works though, sorry.
Yep that’s how i’ve done it so far. But i have a problem with character encoding. For example, trying to display Korean characters appear square boxes. This is the part that’s confusing me. It has something to do with charset and fonts (i think), but i’m unsure how to approach this.
Here’s some korean copied and pasted, i wonder if it displays correctly
If you’re seeing “square boxes” or “question marks” it suggests that you don’t have the needed font on your machine. Or maybe your browser settings for Character Encoding are off?