Best way to translate a site?

My website has some English lines in HTML and JS code (NOT in the database), and I need to translate these lines into other languages ​​(Spanish, Italian, etc.).

What is the best way to do this?

I can save the cookie where the language is, but where can I put these translated lines?

-2
php translation
source share
1 answer

If you do not use a framework like, for example, symfony2 (which has a translation component) or Zend (I am sure that you will have some kind of independent "component"), the way to achieve this is to save the php file with key => value pairs ( or better, an array) and include this file on your page. This way you can search every time and then load the β€œcorrect” tags and similar ...

In addition, the symfony2 translation component can be used as a separate part, so see if it can meet your needs.

0
source share

All Articles