Multilingual Website

Hi everyone,

I was wondering, is there an easy way to make a website multilingual? As some of you may already know, I have a website, which is in spanish, and I would like to add this feature.

I have no Idea about how to do it, but what I have read about it, is that I should create different folders, depending on the amount of the languages I want to add. This language selector, could be done with an input? Will this input collapse with another input I have in the website?

I have little words to translate by now, but I wonder if there could be problems if in case I add a forum (for example), will be any problem if I only want to be available in one of the languages?

Thanks in advice!

No, there is no easy way (apart from Google translate which is too ugly to be mentioned)

Basically you need to change every output operator in your code to a function call, that accepts a phrase and translates it to the chosen language based on the predefined translation file.

So you will need a file where all the phrases used on your site are stored, one file for each language.

And I se no problem for a forum - it is no different from the main site, its interface have to betranslated exactly the same way

Isn’t that the truth!

It is fairly easy for UI components, and for the most part content that you supply.

But for user submitted content, not so much.

I’ve worked some with Gettext, (WordPress uses it) and it works well.

Every translatable text string needs to be mapped to a token value pair

And as colshrapnel posted, every translatable text string needs to be wrapped in a function.

For example, instead of something like


it would be more like

<button><?php __("Submit", ""); ?></button>

where would be the machine version of

"Submit": "Submit"

but might be (lol, used Google translate so forgive me if it’s wrong)

"Submit": "Presentar"

So the problem isn’t so much putting something together that can be used in different languages.
The big problem is having multiple languages happening at the same site.

One solution is to not have “the same site” i.e. sub-domains or sub-folders.
Another is to have different “sections” of the same site for the different languages, under the assumption that visitors will go to the section that is in their language.

AFAIK the Google translate service is rate limited, but I guess it could work if visitors don’t mind reading other members text content in an often less than perfect translation.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.