From 01fb73bd288454e852422c07fdc0264916054904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dumont?= Date: Tue, 19 Jul 2022 19:56:56 +0200 Subject: [PATCH] No need to translate --- Gruntfile.js | 111 +-------------------------------------------------- package.json | 3 -- 2 files changed, 2 insertions(+), 112 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index de431d4..8b35d6a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,102 +25,6 @@ module.exports = function(grunt) { } }, - // Generate .pot file - makepot: { - target: { - options: { - cwd: '', - domainPath: 'languages', // Where to save the POT file. - exclude: [ - 'releases', - 'node_modules', - 'vendor' - ], - mainFile: '<%= pkg.name %>.php', // Main project file. - potComments: 'Copyright (c) {year} Sébastien Dumont\nThis file is distributed under the same license as the CoCart package.', // The copyright at the beginning of the POT file. - potFilename: '<%= pkg.name %>.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. - 'Report-Msgid-Bugs-To': 'https://github.com/co-cart/cocart-cors/issues', - 'language-team': 'Sébastien Dumont ', - 'language': 'en_US' - }, - processPot: function( pot ) { - var translation, - excluded_meta = [ - 'Plugin Name of the plugin/theme', - 'Plugin URI of the plugin/theme', - 'Description of the plugin/theme', - 'Author of the plugin/theme', - 'Author URI of the plugin/theme' - ]; - - for ( translation in pot.translations[''] ) { - if ( 'undefined' !== typeof pot.translations[''][ translation ].comments.extracted ) { - if ( excluded_meta.indexOf( pot.translations[''][ translation ].comments.extracted ) >= 0 ) { - console.log( 'Excluded meta: ' + pot.translations[''][ translation ].comments.extracted ); - delete pot.translations[''][ translation ]; - } - } - } - - return pot; - }, - type: 'wp-plugin', // Type of project. - updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes. - } - } - }, - - // Check strings for localization issues - checktextdomain: { - options:{ - text_domain: '<%= pkg.name %>', // Project text domain. - 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' - ] - }, - files: { - src: [ - '*.php', - '**/*.php', // Include all files - '!node_modules/**', // Exclude node_modules/ - '!vendor/**' // Exclude vendor/ - ], - expand: true - }, - }, - - potomo: { - dist: { - options: { - poDel: false - }, - files: [{ - expand: true, - cwd: 'languages', - src: ['*.po'], - dest: 'languages', - ext: '.mo', - nonull: false - }] - } - }, - // Bump version numbers (replace with version in package.json) replace: { php: { @@ -265,29 +169,18 @@ module.exports = function(grunt) { } ); - // Set the default grunt command to run test cases. - grunt.registerTask( 'default', [ 'test' ] ); + // Set the default grunt command. + grunt.registerTask( 'default', [ 'check' ] ); // Checks for developer dependencies updates. grunt.registerTask( 'check', [ 'devUpdate' ] ); - // Checks for errors. - grunt.registerTask( 'test', [ 'checktextdomain' ] ); - // Update version of plugin. grunt.registerTask( 'version', [ 'replace:php', 'replace:readme' ] ); // Update stable version of plugin. grunt.registerTask( 'stable', [ 'replace:stable' ] ); - /** - * Run i18n related tasks. - * - * This includes extracting translatable strings, updating the master pot file. - * If this is part of a deploy process, it should come before zipping everything up. - */ - grunt.registerTask( 'update-pot', [ 'checktextdomain', 'makepot' ] ); - /** * Creates a deployable plugin zipped up ready to upload * and install on a WordPress installation. diff --git a/package.json b/package.json index e169b11..812b9b2 100644 --- a/package.json +++ b/package.json @@ -58,15 +58,12 @@ }, "devDependencies": { "grunt": "1.5.3", - "grunt-checktextdomain": "1.0.1", "grunt-contrib-clean": "2.0.1", "grunt-contrib-compress": "2.0.0", "grunt-contrib-copy": "1.0.0", "grunt-dev-update": "2.3.0", "grunt-newer": "1.3.0", - "grunt-potomo": "3.5.0", "grunt-text-replace": "0.4.0", - "grunt-wp-i18n": "1.0.3", "load-grunt-tasks": "5.1.0" }, "dependencies": {},