WordPress.org launched recently a new translation mechanism via https://translate.wordpress.org/.
What steps should I make to translate a plugin at wp.org plugin repository correctly?
Can I remove the .po/.mo/.pot files from the plugins folder?
Are the .po/.mo translations already included into the plugin’s translations on https://translate.wordpress.org/ website?
Is it possible to translate theme via this approach?
1 Answer
So to make plugin translatable via translate.wordpress.org you need to add text domain into main plugin’s file:
/*
* Plugin Name: My Plugin
* Author: Plugin Author
* Text Domain: my-plugin
*/
So to make theme translatable via translate.wordpress.org you need to add text domain into main theme’s file:
/*
* Theme Name: My Theme
* Author: Theme Author
* Text Domain: my-theme
*/
And also all the strings should be wrapped with gettext _() functions with the same text domain.
All further details can be found in the official docs below:
- translate.wordpress.org
- how-to-internationalize-your-plugin
- theme internationalization