Home:ALL Converter>How to place automatically the translation files (.po and .mo) in the wp-content/languages/plugins folder when someone installs the plugin

How to place automatically the translation files (.po and .mo) in the wp-content/languages/plugins folder when someone installs the plugin

Ask Time:2023-01-11T01:15:13         Author:ah92

Json Formatter

I'm trying to translate a plugin I published to the WordPress marketplace, but I'm having trouble.

I created the.pot file, compiled the.po and.mo files, and placed them in the /languages folder at wp-content/plugins/name-of-the-plugin. This is only translating the plugin description, it does not translate the plugin setting page that is created when the plugin is installed.

If I copy .po and .mo file and place them under this path: wp-content/languages/plugins/name-of-the-plugin then everything gets translated.

How can I manage to place these translation files automatically into this path (wp-content/languages/plugins/name-of-the-plugin) when someone installs the plugin?

Or please let me know if I'm missing something in this process?

Author:ah92,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/75073577/how-to-place-automatically-the-translation-files-po-and-mo-in-the-wp-content
yy