Grunt TIVWP PO/MO
The grunt-wp-i18n
Grunt plugin for WordPress has an option to make PO files. However, there are situations when you need to do some tasks between creating POT and merging POs. For example, upload the POT to Transifex and download POs from there, and only then - merge and make MOs.
msgmerge
andmsgfmt
must be available in order to run this plugin.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-tivwp-po --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-tivwp-po');
In your project's Gruntfile, add a section named tivwp_po
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
tivwp_po: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
Default value: ''
The relative path to the .pot
file.
Type: Boolean
Default value: true
Whether to compile .po
files to .mo
.
grunt.initConfig({
tivwp_po: {
options: {
pot_file: "languages/my-plugin.pot",
do_mo: true
},
files: [{
expand: true,
cwd : "languages/",
src : ["*.po"]
}]
}
});
- You are more than welcome! Please submit issues and pull requests.
- The first public release.
- MIT