How to change language file used by _e function
I am trying to make my own language switcher for my WordPress site. I am generating all labels using the _e
and similar functions. So I am guessing the only thing I need to do is to change the locale used by WordPress. How can I do this programmatically?
So in the ideal scenario when a user clicks on the desired language "this code" is run and WordPress uses the corresponding .mo
file for the translation.
Topic language multi-language Wordpress
Category Web