From da122cf8f8f30ae21be8760aa3cba412469c8bbb Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Wed, 5 Oct 2016 23:44:28 +0300 Subject: [PATCH 1/4] Automation: Add package.json ; Can be installed with `npm install` command --- package.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 00000000..668a554c --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "TGMPA", + "private": true, + "devDependencies": { + "fs-extra": "^0.30.0", + "gulp": "^3.9.1", + "gulp-sort": "^2.0.0", + "gulp-util": "^3.0.7", + "gulp-wp-pot": "^1.2.2", + "gulp-checktextdomain": "^1.0.2" + } +} From bf8f7b08de6fc47fd23b8052d27943d962711f33 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Wed, 5 Oct 2016 23:45:00 +0300 Subject: [PATCH 2/4] Automation: add .gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..07e6e472 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules From e894e0f5a2e662c441de3b6c1273a43b5780be06 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Wed, 5 Oct 2016 23:45:55 +0300 Subject: [PATCH 3/4] Automation: Add gulpfile.js ; Can be activated with `gulp` command --- gulpfile.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gulpfile.js diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..09a874fb --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,61 @@ +/** + * Give Gulp File + * + * Used for automating development tasks. + */ + +/* Modules (Can be installed with npm install command using package.json) + ------------------------------------- */ +var gulp = require('gulp'), + sort = require('gulp-sort'), + wpPot = require('gulp-wp-pot'), + checktextdomain = require('gulp-checktextdomain'); + +/* POT file task + ------------------------------------- */ +gulp.task('pot', function () { + return gulp.src('**/*.php') + .pipe(sort()) + .pipe(wpPot({ + package: 'TGM Plugin Activation', + domain: 'tgmpa', //textdomain + destFile: 'tgmpa.pot', + lastTranslator: '', + team: 'TGMPA' + })) + .pipe(gulp.dest('languages')); +}); + +/* Text-domain task + ------------------------------------- */ +gulp.task('textdomain', function () { + var options = { + text_domain: 'tgmpa', + keywords: [ + '__:1,2d', + '_e:1,2d', + '_x:1,2c,3d', + 'esc_html__:1,2d', + 'esc_html_e:1,2d', + 'esc_html_x:1,2c,3d', + 'esc_attr__:1,2d', + 'esc_attr_e:1,2d', + 'esc_attr_x:1,2c,3d', + '_ex:1,2c,3d', + '_n:1,2,4d', + '_nx:1,2,4c,5d', + '_n_noop:1,2,3d', + '_nx_noop:1,2,3c,4d' + ], + correct_domain: true + }; + return gulp.src('**/*.php') + .pipe(checktextdomain(options)) +}); + +/* Default Gulp task + ------------------------------------- */ +gulp.task('default', function () { + // Run all the tasks! + gulp.start('textdomain','pot'); +}); From 5d4d7fb900043cd3f81f0836cd198f212d3bf4a6 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Tue, 11 Oct 2016 17:11:12 +0300 Subject: [PATCH 4/4] move the translators comments outside the _n_noop() fuction --- class-tgm-plugin-activation.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php index e4656afb..8259ae5a 100755 --- a/class-tgm-plugin-activation.php +++ b/class-tgm-plugin-activation.php @@ -338,38 +338,38 @@ public function init() { /* translators: %s: plugin name. */ 'updating' => __( 'Updating Plugin: %s', 'tgmpa' ), 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ), + /* translators: 1: plugin name(s). */ 'notice_can_install_required' => _n_noop( - /* translators: 1: plugin name(s). */ 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'tgmpa' ), + /* translators: 1: plugin name(s). */ 'notice_can_install_recommended' => _n_noop( - /* translators: 1: plugin name(s). */ 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'tgmpa' ), + /* translators: 1: plugin name(s). */ 'notice_ask_to_update' => _n_noop( - /* translators: 1: plugin name(s). */ 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'tgmpa' ), + /* translators: 1: plugin name(s). */ 'notice_ask_to_update_maybe' => _n_noop( - /* translators: 1: plugin name(s). */ 'There is an update available for: %1$s.', 'There are updates available for the following plugins: %1$s.', 'tgmpa' ), + /* translators: 1: plugin name(s). */ 'notice_can_activate_required' => _n_noop( - /* translators: 1: plugin name(s). */ 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'tgmpa' ), + /* translators: 1: plugin name(s). */ 'notice_can_activate_recommended' => _n_noop( - /* translators: 1: plugin name(s). */ 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'tgmpa'