Have you ever wondered how can you use two different languages in WordPress? Well I don’t know about others, but I personally don’t like the Bengali translation that much in dashboard. Coincidentally one of my Facebook friend asked me about using English in dashboard and Bengali in front!
I have never tried doing this, but my sharp little brain instantly got a witty hack idea! If you are a developer, and worked with the internationalization of WordPress, then you may know, we can set the language of WordPress from wp-admin → Settings → General. But that language works on both front and back.
I have set the language to English (United States) from settings. So both front end and back end is showing English.
The theme is responsible for the front end interface. So I have translated the theme into Bengali (Bangladesh) and put the file in `wp-content/languages/themes/`.
If you are wondering why I did not put the file on
wp-content/themes/myTheme/languages/, because the translation file will be erased upon update.
What’s the hack?
The theme translation file contains the translation for Bengali (Bangladesh). So the file name should be `mytheme-bn_BD.mo` but I have named the file `mytheme-en_US.mo`. Because WordPress is set to load the English language. If I name the file for Bengali, it will not work.
Is this legal?
NO! This is completely offensive and might piss off some “Standards Nazis”. This is never a recommended way. I personally never recommend this kind of hipster configuration and alteration. But hackers never worked in conventional ways 😉
If you really feel witty today and thinking about using different languages, then you may test on your localhost.
You can’t curse me for using this trick on your live site. Go ahead, but on your own risk!