forked from devinsays/portfolio-press
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update package for wp-i18n - makepot - exec
- Loading branch information
Showing
2 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,11 +45,51 @@ module.exports = function(grunt) { | |
target: { | ||
options: { | ||
domainPath: '/languages/', // Where to save the POT file. | ||
potFilename: 'portfolio-press.pot', // Name of the POT file. | ||
type: 'wp-theme' // Type of project (wp-plugin or wp-theme). | ||
potFilename: 'portfolio-press.pot', // Name of the POT file | ||
potHeaders: { | ||
poedit: true, // Includes common Poedit headers. | ||
'x-poedit-keywordslist': true // Include a list of all possible gettext functions. | ||
}, | ||
type: 'wp-theme', // Type of project (wp-plugin or wp-theme). | ||
updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes. | ||
processPot: function( pot, options ) { | ||
pot.headers['report-msgid-bugs-to'] = 'http://wptheming.com/'; | ||
pot.headers['last-translator'] = 'WP-Translations (http://wp-translations.org/)'; | ||
pot.headers['language-team'] = 'WP-Translations <[email protected]>'; | ||
pot.headers['language'] = 'en_US'; | ||
return pot; | ||
} | ||
} | ||
} | ||
}, | ||
exec: { | ||
txpull: { // Pull Transifex translation - grunt exec:txpull | ||
cmd: 'tx pull -a --minimum-perc=100' // Change the percentage with --minimum-perc=yourvalue | ||
}, | ||
txpush_s: { // Push pot to Transifex - grunt exec:txpush_s | ||
cmd: 'tx push -s' | ||
}, | ||
}, | ||
|
||
dirs: { | ||
lang: 'languages', | ||
}, | ||
|
||
potomo: { | ||
dist: { | ||
options: { | ||
poDel: false // Set to true if you want to erase the .po | ||
}, | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= dirs.lang %>', | ||
src: ['*.po'], | ||
dest: '<%= dirs.lang %>', | ||
ext: '.mo', | ||
nonull: true | ||
}] | ||
} | ||
}, | ||
cssjanus: { | ||
theme: { | ||
options: { | ||
|
@@ -74,4 +114,13 @@ module.exports = function(grunt) { | |
'cssjanus' | ||
]); | ||
|
||
// Default task. - grunt makepot | ||
grunt.registerTask( 'default', 'makepot' ); | ||
|
||
// Makepot and push it on Transifex task(s). | ||
grunt.registerTask( 'makandpush', [ 'makepot', 'exec:txpush_s' ] ); | ||
|
||
// Pull from Transifex and create .mo task(s). | ||
grunt.registerTask( 'tx', [ 'exec:txpull', 'potomo' ] ); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters