I translated all my theme strings and saved in .po and .mo files. I tested the implementation and it works fine, however I’m not sure how to let users choose their own language.
Are there any built-in functions to do this? How do I do it?
I translated all my theme strings and saved in .po and .mo files. I tested the implementation and it works fine, however I’m not sure how to let users choose their own language.
Are there any built-in functions to do this? How do I do it?
Comments are closed.
Add filter in your child theme like this
You can create the languages dropdown on front-end or any settings on backend where user can easily switch.
Then get the selected lang in $_GET variable and return that lang.
There are two types of translations in the WordPress website:
technique is useful (as mentioned by you .po and .mo files)
Content Translations for that you will need to add multi-lingual
plugin to handle such feature. Good Example of such plugin are:
Use a multilingual plugin like Polylang