0

I am seeing many sites on the web that suggest a language choice - usually two or three languages and it changes the entire site into the selected language.

  • I want to know how to do it professionally?

  • Is there any plugin that makes life easier?

  • can google-translate be molded to make this happen?

  • I want to change the language of my site to 7-languages? How can this be done?

  • my site uses HTML,css,JQuery,AJAX and PHP, MySQL...so kindly guide me as such.

  • what I am currently doing is loading a different page (which has been written in that language) when a user click on any language.

Here is my code:

<a href="page_lang1">lang 1</a><br/>
<a href="page_lang2">lang 2</a>
Ivaylo Slavov
  • 8,839
  • 12
  • 65
  • 108
prantik Vaghela
  • 39
  • 1
  • 1
  • 8

3 Answers3

1

use language files to store your i18n like this:

en.php

$lang['hello'] = 'hello';

fr.php

$lang['hello'] = 'bonjour';

then in your code, use something like this instead of directly writing the word:

echo lang('hello');

with the function:

function lang($key){
  return $lang[$key];
}

And then load en.php if language is set to en, fr for fr, etc...

Igoooor
  • 397
  • 2
  • 9
0

You can achieve this by many ways. It depends on how you would like to do it.

In PHP if you use a specific modern framework I'm sure you would find something related.

In jQuery you can also find some plugins that would do the job.

But as for 7 languages, I can expect that you might have rtl languages, such as Arabic or Hebrew, in this case you don't need only a translation way, but you also need to modify your css.

Hope this helps.

Hatem Alimam
  • 9,968
  • 4
  • 44
  • 56
-1

Multi-regional and multilingual sites

yes you can do that with the help of google translate and as far as i know this is a easier approach than the others and saves a lot of time.

you are probably looking for this,go though the link:

https://support.google.com/webmasters/answer/182192?hl=en

R R
  • 2,999
  • 2
  • 24
  • 42