I have installed a wordpress theme, i can see the .mo and .po /public_html/wp-content/themes/themename/lang
, the language I want to use is available.
Could you please advise on how to use a specific language? I don’t want to change the admin language just the theme language.
Well, you actually do not need anything special to have two different languages in the back end and in the front end. I just tested it again on WP 5.1
go to the
settings
and set theSite Language
to the front end laguage, for example – German, then save.go to
Users
and then click edit on your administrator account. There you can setLanguage
to English and save. That’s it. Your front end will use German as base and the back end will be in English.If anyone is still looking for that, here is what you should do since version 4.7
This forces the dashboard to load in English, then you can go to settings, set the language you desire.
You can filter the string for
locale
, it holds the current language. And you can exclude the admin from that filter:I think that your simplest option would be to update your installation using the localized version of WordPress for your native language (and making sure that
WPLANG
remains set accordingly), and then to use a plugin such as:… in order to switch just the admin interface to English.
Here is the complete and a better solution to only change theme (front-end) or plugin language. It even works for changing even a specific page/post etc. language as well.
TLDR; There is a filter called
locale
, which determines which language to load. You can change to your specific language based on the conditions that you prefer.Changing only Theme language, or based on other conditions, without touching the admin dashboard language.
Before you change the language, you may need to load that language first.
In your theme or child theme, load the custom language by using this snippet.
Similarly, you can change language based on URL, or for your plugin page, etc.
Hope it’ll help. OR let me know if I missed something.
You can also try this:
1.Download jquery translate script from this link
2.How it works ( doc, live test )
Here is an example code snippet that you can use to change the language dynamically in WordPress: