1

I've got a website under development and it is in spanish. Now i want to translate it to english. The website is composed of 8 pages. I have added the english flag on top of the website but i was wondering how to do the integration of multiple idioms on my website. I can think of two alternatives:

1.- Clone each page and translate it. After that, inside the root folder create two folders "/es/" and another "/en/". This way, when clicking on the flag i just have to change the url from www.ejemplo.com/es/index.html to www.ejemplo.com/en/index.html. The problem I can see is that if later I translate the site to other idioms i have to generate new folders, more files.... On the other hand, I think this solution can be better for google position as the url is cleaner...

2.- Add a parameter in the url: www.ejemplo.com/index.html?lang=en . I would have all the text in the website in JS and I would load the text in the correct idiom after reading the url parameter.

I don't know which method is better or if there is a better method for dealing with languages...

I must say that I am using HTML5 + CSS3 + JS (and jquery) in the frontend and node.js in the backend...

Any help will be appreciated..

Egidi
  • 1,736
  • 8
  • 43
  • 69
  • 2
    So if nodejs generates your pages isn't it suitable to generate them already with proper language? – u_mulder Mar 04 '15 at 19:03
  • nodejs is just serving the data (tables, user_info, etc). The pages are already generated. – Egidi Mar 04 '15 at 19:10
  • Without a CMS system this is going to be a **LOT** of work...I've never seen a site get smaller... – Tim Mar 04 '15 at 19:39

2 Answers2

1

Easiest way to achieve is using Google Translate

You can see other suggestions at following question on SO:

Best practice multi language website

Following blog also have lot of useful information

Creating A Multilingual Website: A Beginner’s Guide

Hoping this information helps.

Cheers !

Community
  • 1
  • 1
Sachin Thapa
  • 3,559
  • 4
  • 24
  • 42
0

you can use navigator.language to find the language used by user and then accordingly load the required language stored in your js.

Ankit Chaudhary
  • 4,059
  • 1
  • 11
  • 23
  • better solution than mines! perfct! – Egidi Mar 04 '15 at 19:33
  • 1
    This isn't always reliable, especially in Europe. (I worked for a company that hired consultants to scope this out, and they advised against it) – Tim Mar 04 '15 at 19:41