0

I'm creating a new plugin actually, the plugin is working perfectly, but it's not available yet in the wordpress.org website, I have an issue with the translation, I will not use wordpress.org for the translation, it's a local translation, so I generated the PO and MO files using POedit, and I followed all the steps here : https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/ from writing a perfect header in the main plugin file till adding php code in the same file in order to load text domain and the MO file, When I change the wordpress language from English to French, the plugin still with EN language,

What can be the issue ? is it because the plugin is not on the wordpress.org yet ?

Here's my laptop config :

  • locahost : wampserver
  • Windows 10
  • Php version : 8.1

Thanks !!

1 Answer 1

1

Here's the solution : I'm talking about my case here, When I added the Text Domain Name to Gettext functions in interface.php file, I used this command line : php add-textdomain.php TextDomainNameOfThePlugin PathToInterfaceFile/interface.php > tdn.php , So I generated tdn.php as you can see in that command line, and constructed my POT, PO and MO files based on this UNUSED NEW FILE, and I forgot to either rename tdn.php to interface.php (and delete the old interface.php) so I can use it, or to copy its content and paste in into interface.php file that didn't contain Text Domain Name in its Gettext functions.

So now, I just copied tdn.php content to interface.php, and the translation works perfectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.