Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate obsolete i18n code #1789

Merged
merged 5 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ node_modules
wiki
amp.zip
**/*-compiled.js
languages/*.pot
languages/*.php
built
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ jobs:
env: WP_VERSION=latest DEV_LIB_ONLY=composer,grunt
script:
- |
if ! command -v wp >/dev/null 2>&1; then
mkdir -p /tmp/wp-cli
wget -O /tmp/wp-cli/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x /tmp/wp-cli/wp
export PATH="/tmp/wp-cli:$PATH"
wp cli update --yes --nightly # Temporary until WP-CLI 2.1 or 2.0.1
fi
eval "$(ssh-agent -s)"
pantheon_branch=$( echo $TRAVIS_BRANCH | sed 's/^\([0-9]\)/v\1/' | sed 's/[^a-z0-9-]/-/' )
echo "Initializing deployment to Pantheon branch: $pantheon_branch"
Expand Down
11 changes: 1 addition & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ module.exports = function( grunt ) {
webpack_production: {
command: 'cross-env BABEL_ENV=production webpack'
},
pot_to_php: {
command: 'npm run pot-to-php && php -l languages/amp-translations.php'
},
makepot: {
command: 'wp i18n make-pot . languages/amp-js.pot --include="*.js" --file-comment="*/null/*"' // The --file-comment is a temporary workaround for <https://github.com/ampproject/amp-wp/issues/1416>.
},
create_build_zip: {
command: 'if [ ! -e build ]; then echo "Run grunt build first."; exit 1; fi; if [ -e amp.zip ]; then rm amp.zip; fi; cd build; zip -r ../amp.zip .; cd ..; echo; echo "ZIP of build: $(pwd)/amp.zip"'
}
Expand Down Expand Up @@ -80,8 +74,6 @@ module.exports = function( grunt ) {
stdout = [];

grunt.task.run( 'shell:webpack_production' );
grunt.task.run( 'shell:makepot' );
grunt.task.run( 'shell:pot_to_php' );

spawnQueue.push(
{
Expand All @@ -101,13 +93,12 @@ module.exports = function( grunt ) {
versionAppend = new Date().toISOString().replace( /\.\d+/, '' ).replace( /-|:/g, '' ) + '-' + commitHash;

paths = lsOutput.trim().split( /\n/ ).filter( function( file ) {
return ! /^(blocks|\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*|webpack.*|languages\/README.*)/.test( file );
return ! /^(blocks|\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*|webpack.*)/.test( file );
} );
paths.push( 'vendor/autoload.php' );
paths.push( 'assets/js/*-compiled.js' );
paths.push( 'vendor/composer/**' );
paths.push( 'vendor/sabberworm/php-css-parser/lib/**' );
paths.push( 'languages/amp-translations.php' );

grunt.task.run( 'clean' );
grunt.config.set( 'copy', {
Expand Down
1 change: 1 addition & 0 deletions assets/js/amp-block-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ var ampBlockValidation = ( function() { // eslint-disable-line no-unused-vars
blockErrorCount = validationErrors.length - blockValidationErrors.other.length;
if ( blockErrorCount > 0 ) {
noticeMessage += ' ' + wp.i18n.sprintf(
/* translators: %s is the count of block errors. */
wp.i18n._n(
'And %s is directly due to content here.',
'And %s are directly due to content here.',
Expand Down
3 changes: 2 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ When you push a commit to your PR, Travis CI will run the PHPUnit tests and snif

Contributors who want to make a new release, follow these steps:

0. Do `git submodule update --init --recursive && npm install && composer selfupdate && composer install && wp cli update`.
0. Do `git submodule update --init --recursive && npm install && composer selfupdate && composer install`.
1. Bump plugin versions in `amp.php` (×2: the metadata block in the header and also the `AMP__VERSION` constant). Verify via `npx grunt shell:verify_matching_versions`.
2. Add changelog entry to readme.
3. Do `npm run build` and install the `amp.zip` onto a normal WordPress install running a stable release build; do smoke test to ensure it works.
Expand Down
16 changes: 0 additions & 16 deletions languages/README.md

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
},
"main": "blocks/index.js",
"scripts": {
"pot-to-php": "pot-to-php languages/amp-js.pot languages/amp-translations.php amp",
"build": "grunt build && grunt create-build-zip",
"deploy": "grunt deploy",
"dev": "cross-env BABEL_ENV=default webpack --watch"
Expand Down