Skip to content

Commit

Permalink
Merge branch 'Release/7.3.4-beta1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Nov 2, 2022
2 parents 71f6e18 + 606c8a6 commit 611b48d
Show file tree
Hide file tree
Showing 46 changed files with 14,024 additions and 22,410 deletions.
37 changes: 37 additions & 0 deletions check-translations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/bash

#copy potFile
cp en_GB.pot en_GB.po
echo "en_GB.po created"
#remove header
sed -i '' -e '1,17d' en_GB.po
#remove msgctxt
sed -i '' -e 's/msgctxt.*//g' en_GB.po
#remove msgstr
sed -i '' -e 's/msgstr.*//g' en_GB.po
#remove comments
sed -i '' -e 's/#.*//g' en_GB.po
#remove empty lines
sed -i '' -e '/^$/d' en_GB.po
#create array of file names
files=($(ls -1 *.po))
#for each file in files
for file in "${files[@]}"
do
#copy file to temp-file
cp $file temp.po
#remove header
sed -i '' -e '1,17d' temp.po
#remove msgctxt
sed -i '' -e 's/msgctxt.*//g' temp.po
#remove msgstr
sed -i '' -e 's/msgstr.*//g' temp.po
#remove comments
sed -i '' -e 's/#.*//g' temp.po
#remove empty lines
sed -i '' -e '/^$/d' temp.po
#diff en_GB.po with all other files
diff en_GB.po temp.po > $file.diff
#remove temp-file
rm temp.po
done
21 changes: 21 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const usage = require('gulp-help-doc')
const zip = require('gulp-zip')
const rename = require('gulp-rename')
const date = require('date-and-time')
const wpPot = require('wp-pot')

const options = {
...minimist(
Expand Down Expand Up @@ -272,6 +273,22 @@ function _archive({baseDir, buildDir, distDir, packageVersion, packageName}) {
}
}

function _generatePotFile ({buildDir, langDir}) {
return async function generatePotFile (done) {
wpPot({
destFile: `languages/en_GB.pot`,
includePOTCreationDate: false,
src: [
`mollie-payments-for-woocommerce.php`,
`src/**/*.php`,
`inc/**/*.php`,
]
});

done()
}
}

// --------------------------------------------------------------------
// TARGETS
// --------------------------------------------------------------------
Expand Down Expand Up @@ -327,3 +344,7 @@ exports.dist = series(
exports.default = series(
exports.build
)

exports.generatePotFile = series(
_generatePotFile(options)
)
14 changes: 14 additions & 0 deletions inc/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ function untrailingslashit($string)
}
}

if (!function_exists('as_unschedule_action')) {
/**
* @since WooCommerce 3.0.0
* @param string $hook
* @param array $args
* @param string $group
* @return bool
*/
function as_unschedule_action($hook, $args = [], $group = '')
{
return 0;
}
}

function mollieWooCommerceSession()
{
return WC()->session;
Expand Down
Loading

0 comments on commit 611b48d

Please sign in to comment.