WordPress plugin translation problem

I translated my plugin using poedit and it works fine on localhost, on a fresh new Wordpress installation, but when I uploaded my plugin on the server, on an existing site, some Russian attributes were missing. I get latin istead, I have encoded poedite files with utf8, same in header I have utf8. Where colud be a problem, another poedit translation for Romanian works well? In fact, Russian words are translated, but some letters are still in Latin.

Are there any settings in the config file or something else? Also, I am downloading another Wordpress site and trying to connect it to my localhost, the same can be said for the fact that some Russian chats are missing. Could there be a problem with some of the Wordpress settings?

So the Russian translation is working on a new new basic wordpress installation, not when I install my plugin on a site that already exists.

+3


source to share


2 answers


Usually, the string for translations is not stored in the database, so MySQL settings are usually not a problem. But to have the correct UTF-8 encoding with translations, make sure these requirements are set:

  • Encode your PHP plugin files in UTF-8 (no BOM), not ANSI
  • Make sure your .po file is UTF-8 encoded, just like the plugin file
  • Check the "header" of your .po file for the correct UTF-8 setting:
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

      



  1. Make sure the HTTP response is UTF-8 encoded

If all of these requirements are met, you should see the correct encoded characters.

+3


source


Links to WordPress Dev StackExchange:



+1


source







All Articles