Add alternative language

Asked by:
Styx Growler / 34 Points
Time:
2012-04-17 6:18 pm EST
Category:
How To
Hits:
575
I'm thinking of making my site bi lingual. I don't want to use Google Translate. Can I simply make a complete copy of my site and put a link to the new site on my existing site? That sounds a bit scary. How do I do it, please?

Styx
www.styxgrowler.com

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

ChristiNi
Staff
13,688 Points
2012-04-17 6:59 pm EST
Hello Styx,

Great question about providing a version of your site in another language. There are several different ways to implement different language versions of your site, depending on whether you use a CMS (Content Management System) or not. While checking into this for you, I see that your site files are HTML coded files, and it doesn't look like you're using a CMS to build your site.

While you could simply place your alternate language files in another folder and link to that version of your site, using Content Negotiation, you can make the experience a bit more seamless for your visitors. You also can keep both versions of your files in the same directory.

You already have an English version of your site, and perhaps you want to create a French version. The first step is to turn on Multiviews by creating and/or editing an .htaccess file in your document root. In that .htaccess file, add the following code:

Options +MultiViews
AddLanguage en .en
AddLanguage fr .fr

Next, all of the English versions of your site files should have .en appended to the end of the file names (e.g. index.html.en, aboutus.html.en, etc.). All of the French versions of your site files should have .fr appended to the end of the file names (e.g. index.html.fr, aboutus.html.fr). Remember, these files should be in the same directory, no need for a separate directory for each language.

When a visitor comes to the site, their preferred language will be determined based on the language they have selected when they installed their browser. Anyone can also view a direct link to a specific file (e.g. index.html.en or index.html.fr).

One important note, is that links to pages should not file extensions. For instance, if you wanted to link from your index page to your About Us page in the above example, the link URL would be http://yourdomain.com/aboutus instead of http://yourdomain.com/aboutus.htm. This way, the correct language version of that page can be served correctly to the visitor.

Please let us know if you have any additional questions or need further assistance.

Regards,

Christi N.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}