How do I make a translation system in PHP and keep the translation when swapping pages? [duplicate]

0

Well, I'm in need of a translation system via PHP, but I hope that the translation will look like this: mydomain .com.br / en or www.yourdomain.com/en at the same time that it will save the type of language, I want you to enter into other pages, getting something like this: www.mydomain.com/en/register or www.mydomain.com/register in relation to the translation of link, this I know how to do, but I want this system style, if you know how I can help me. I've researched the net, but I only find old systems that do not work.

    
asked by anonymous 02.10.2018 / 01:29

1 answer

0

There are several ways to do translation, one of them is using the database and referencing the word for each of the languages.

The other way would be to save to a text file.

Which one should I use? It depends on your project, see Wordpress, does not use the bank to translate your system.

Within your question there are 2 problems, not 1 only, try to untangle as much as possible.

  • translate
  • Routing.
  • I suggest that you research more about routing and try to learn as much as you can, the language change is a route parameter question, when you identify the parameter of that request, you pass on the translation that you like.

        
    02.10.2018 / 02:45