How I can implement auto-translation of my website with multi language

2.6k views Asked by At

I would like to implement multi-language feature in one of my website. I am familiar with the method that, keeping the multiple label values in variable and display the value based on the user selected language. But this method will not work with the user input values. example, if they entered their name in english, it will display in english only, even if the end user/site vistor choose the German language. So, is any alternative method to convert the entire site into another language. We are using PHP as the platform.

1

There are 1 answers

2
Onema On

In the past I have use a third party service to dynamically translate a website to multiple languages.

There are a number of companies that offer this service, the one that we used is called Firma8. Google also has a similar service.

As I remember there are different ways this can be setup for Firma8:

  1. Using a proxy: Request to your site would be routed through one of their proxies where it would identify what language is being requested eg: es.website.com for Spanish, or de.website.com for German, etc. The proxy will return a version of the site translated. You can test this functionality in their own website.

  2. Using their API: I ended up using the API as it allowed me to programmatically translate the pieces of the site that I wanted. I even ended mixing this dynamic translation system with my framework internationalization system. That way I had chunks that where translated (and cached) "on the fly", and internationalization files that where generated automatically using the API.

Firma8 has a way to fine tune the translations so you can "teach" the system how, what and when to translate. You may want to translate a person's name from English to Spanish, but not to Korean as there may not be a direct translation.

They didn't have a PHP client, so I ended up creating my own, unfortunately I was not allowed to Open Source it. You can use tools like Guzzle to quickly create an HTTP client.