W
W
Worddoc2017-01-27 14:46:16
PHP
Worddoc, 2017-01-27 14:46:16

How to localize a site for a couple of languages?

Hello.
I have never localized sites before, but now there is such a need.
I think to insert a php function together with the text, which returns the text in the desired language from the array, given the global variable. Is this the right approach? Are there better (native) options? What should be considered when initializing a project? Goal: php practice, because. Prior to that, I only did front-end.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Svirsky, 2017-01-27
@Worddoc

Add prefix /:lang to the URL
It will be:
/ru/content
/en/content
And already in PHP you process it depending on the parameter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question