What is the best way to translate projects in PHP? [duplicate]

0

I finished a course website these days, and one of the requirements was to have at least 3 languages support, after searching for a while I saw that a very recommended method was to create the same array in separate files, same keys, just changing the value of each key, and give include depending on the selected language (made per cookie).

My question is: was this really the best method? My project was not there that giant monster, but it gave a weary one to call every word or phrase like array in each file of him.

    
asked by anonymous 28.06.2017 / 05:36

1 answer

0

You should use php-gettext with support for .po or .pot files, similar to what is done in Wordpress. See this guide:

http://www.devin.com.br/php-gettext/
    
28.06.2017 / 05:44