Skip to content

Commit

Permalink
Re-include addtextdomain functionality via Grunt for the moment (#5526
Browse files Browse the repository at this point in the history
)

* Re-add a Gruntfile so we can automate adding textdomains.

* Add in omitted textdomains.

* Add Gruntfile.js to .svnignore to avoid deploying with release.

* Added yarn scripts and gulp-cli to be able to run them locally.
  • Loading branch information
George Stephanis authored and samhotchkiss committed Nov 8, 2016
1 parent 0fa10d4 commit 45dbeac
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 11 deletions.
1 change: 1 addition & 0 deletions .svnignore
Expand Up @@ -10,6 +10,7 @@ phpunit.xml.dist
tests
tools
package.json
Gruntfile.js
gulpfile.js
node_modules
languages/jetpack.pot
Expand Down
42 changes: 42 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,42 @@
/* global module, require */

module.exports = function(grunt) {
var path = require( 'path' ),
cfg = {
pkg: grunt.file.readJSON('package.json'),
makepot: {
jetpack: {
options: {
domainPath: '/languages',
exclude: [
'node_modules',
'tests',
'tools'
],
mainFile: 'jetpack.php',
potFilename: 'jetpack.pot'
}
}
},
addtextdomain: {
jetpack: {
options: {
textdomain: 'jetpack'
},
files: {
src: [
'*.php',
'**/*.php',
'!node_modules/**',
'!tests/**',
'!tools/**'
]
}
}
}
};

grunt.initConfig( cfg );

grunt.loadNpmTasks('grunt-wp-i18n');
};
2 changes: 1 addition & 1 deletion modules/videopress/utility-functions.php
Expand Up @@ -114,7 +114,7 @@ function videopress_download_poster_image( $url, $attachment_id ) {
// Set variables for storage, fix file filename for query strings.
preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $url, $matches );
if ( ! $matches ) {
return new WP_Error( 'image_sideload_failed', __( 'Invalid image URL' ) );
return new WP_Error( 'image_sideload_failed', __( 'Invalid image URL', 'jetpack' ) );
}

$file_array = array();
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/contact-info.php
Expand Up @@ -265,7 +265,7 @@ function form( $instance ) {
<?php _e( 'Google Maps API Key', 'jetpack' ); ?>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'apikey' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'apikey' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['apikey'] ); ?>" />
<br />
<small><?php printf( wp_kses( __( 'Google now requires an API key to use their maps on your site. <a href="%s">See our documentation</a> for instructions on acquiring a key.' ), array( 'a' => array( 'href' => true ) ) ), 'https://jetpack.com/support/extra-sidebar-widgets/contact-info-widget/' ); ?></small>
<small><?php printf( wp_kses( __( 'Google now requires an API key to use their maps on your site. <a href="%s">See our documentation</a> for instructions on acquiring a key.', 'jetpack' ), array( 'a' => array( 'href' => true ) ) ), 'https://jetpack.com/support/extra-sidebar-widgets/contact-info-widget/' ); ?></small>
</label>
</p>

Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -21,7 +21,9 @@
"build-production": "yarn run clean && yarn run build && yarn run build-languages && gulp languages:extract && NODE_ENV=production BABEL_ENV=production yarn run build",
"build-languages": "gulp languages",
"lint": "eslint _inc/client -c .eslintrc",
"test-client": "NODE_ENV=test NODE_PATH=tests:_inc/client:node_modules/@automattic/dops-components/client tests/runner.js"
"test-client": "NODE_ENV=test NODE_PATH=tests:_inc/client:node_modules/@automattic/dops-components/client tests/runner.js",
"add-textdomain": "./node_modules/.bin/grunt addtextdomain",
"build-pot": "./node_modules/.bin/grunt makepot"
},
"dependencies": {
"@automattic/custom-colors-loader": "automattic/custom-colors-loader",
Expand All @@ -45,6 +47,7 @@
"eslint-plugin-react": "3.6.3",
"extract-text-webpack-plugin": "0.9.1",
"glotpress-js": "0.0.6",
"grunt-cli": "^1.2.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.2",
"gulp-babel": "^5.2.1",
Expand Down Expand Up @@ -97,6 +100,8 @@
"babel-register": "^6.8.0",
"chai": "^3.5.0",
"commander": "2.3.0",
"grunt": "^0.4.2",
"grunt-wp-i18n": "~0.4.6",
"gulp-uglify": "^2.0.0",
"mocha": "^2.4.5",
"mockery": "^1.4.1",
Expand Down

0 comments on commit 45dbeac

Please sign in to comment.