Skip to content
Closed
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
12 changes: 8 additions & 4 deletions environments/translate/bin/after-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,21 @@ $WP wp eval '
// into index-locales.php where current_count / all_count throws DivisionByZeroError.
$counts = $proj->get_project_translation_counts( $s->project_id, $s->locale, $s->slug );
if ( 0 === (int) $counts["all"] ) { continue; }
// has_pending mirrors production (denormalized "waiting > 0 OR fuzzy > 0").
// wporg-gp-routes/class-locale "needs attention" queries scan on it.
$has_pending = ( $counts["waiting"] > 0 || $counts["fuzzy"] > 0 ) ? 1 : 0;
$wpdb->query( $wpdb->prepare(
"INSERT INTO {$wpdb->prefix}gp_project_translation_status
(project_id, locale, locale_slug, `all`, `current`, `waiting`, `fuzzy`, `warnings`, `untranslated`, date_added, date_modified)
VALUES (%d, %s, %s, %d, %d, %d, %d, %d, %d, NOW(), NOW())
(project_id, locale, locale_slug, `all`, `current`, `waiting`, `fuzzy`, `warnings`, `untranslated`, has_pending, date_added, date_modified)
VALUES (%d, %s, %s, %d, %d, %d, %d, %d, %d, %d, NOW(), NOW())
ON DUPLICATE KEY UPDATE
`all`=VALUES(`all`), `current`=VALUES(`current`), `waiting`=VALUES(`waiting`),
`fuzzy`=VALUES(`fuzzy`), `warnings`=VALUES(`warnings`), `untranslated`=VALUES(`untranslated`),
date_modified=NOW()",
has_pending=VALUES(has_pending), date_modified=NOW()",
$s->project_id, $s->locale, $s->slug,
(int) $counts["all"], (int) $counts["current"], (int) $counts["waiting"],
(int) $counts["fuzzy"], (int) $counts["warnings"], (int) $counts["untranslated"]
(int) $counts["fuzzy"], (int) $counts["warnings"], (int) $counts["untranslated"],
$has_pending
) );
}
$proj->cache_wp_themes_wp_plugins_strings();
Expand Down
12 changes: 5 additions & 7 deletions environments/translate/bin/extra-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS `wp_gp_user_projects` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `wp_gp_project_translation_status` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`project_id` int(10) unsigned NOT NULL,
`locale` varchar(10) NOT NULL,
`locale_slug` varchar(255) NOT NULL,
Expand All @@ -37,14 +37,12 @@ CREATE TABLE IF NOT EXISTS `wp_gp_project_translation_status` (
`fuzzy` int(10) unsigned NOT NULL DEFAULT '0',
`warnings` int(10) unsigned NOT NULL DEFAULT '0',
`untranslated` int(10) unsigned NOT NULL DEFAULT '0',
`has_pending` tinyint(1) NOT NULL DEFAULT 0,
`date_added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `project_locale` (`project_id`,`locale`,`locale_slug`),
KEY `all` (`all`),
KEY `current` (`current`),
KEY `waiting` (`waiting`),
KEY `fuzzy` (`fuzzy`),
KEY `warnings` (`warnings`),
KEY `untranslated` (`untranslated`)
KEY `locale` (`locale`,`locale_slug`,`has_pending`),
KEY `date_added` (`date_added`),
KEY `date_modified` (`date_modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
12 changes: 8 additions & 4 deletions environments/translate/bin/import-wp-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,18 @@
if ( 0 === (int) $counts['all'] ) {
continue;
}
// has_pending mirrors production (denormalized "waiting > 0 OR fuzzy > 0").
// wporg-gp-routes/class-locale "needs attention" queries scan on it.
$has_pending = ( $counts['waiting'] > 0 || $counts['fuzzy'] > 0 ) ? 1 : 0;
$wpdb->query(
$wpdb->prepare(
"INSERT INTO {$wpdb->prefix}gp_project_translation_status
(project_id, locale, locale_slug, `all`, `current`, `waiting`, `fuzzy`, `warnings`, `untranslated`, date_added, date_modified)
VALUES (%d, %s, %s, %d, %d, %d, %d, %d, %d, NOW(), NOW())
(project_id, locale, locale_slug, `all`, `current`, `waiting`, `fuzzy`, `warnings`, `untranslated`, has_pending, date_added, date_modified)
VALUES (%d, %s, %s, %d, %d, %d, %d, %d, %d, %d, NOW(), NOW())
ON DUPLICATE KEY UPDATE
`all`=VALUES(`all`), `current`=VALUES(`current`), `waiting`=VALUES(`waiting`),
`fuzzy`=VALUES(`fuzzy`), `warnings`=VALUES(`warnings`), `untranslated`=VALUES(`untranslated`),
date_modified=NOW()",
has_pending=VALUES(has_pending), date_modified=NOW()",
$set_row->project_id,
$set_row->locale,
$set_row->slug,
Expand All @@ -211,7 +214,8 @@
(int) $counts['waiting'],
(int) $counts['fuzzy'],
(int) $counts['warnings'],
(int) $counts['untranslated']
(int) $counts['untranslated'],
$has_pending
)
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* cssnano configuration.
*
* Mirrors the default preset that @wordpress/scripts applies, but forces the
* `@charset "utf-8"` rule to be emitted. The stylesheet embeds Dashicons glyphs
* as literal (non-ASCII) characters in `content` values, and the charset rule
* ensures they are decoded correctly regardless of how the file is served.
*/
module.exports = {
preset: [
'default',
{
discardComments: { removeAll: true },
normalizeCharset: { add: true },
},
],
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

```
npm install
grunt watch # Run linters, build Sass, JS client, etc.
npm start # Watch and rebuild the stylesheet, blocks, and JS client.
```

The Sass partials under `client/styles/{settings,tools,objects,components}/` are
aggregated by hand-maintained `_*.scss` index files. When adding a new partial,
remember to `@import` it from the matching index file, or it won't be bundled.

#### Committing

Before committing changes to `js/client`, please create a build version to keep the file size down.
Before committing changes, please create a build version to keep the file size down.

```
grunt build
npm run build
svn ci
```
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '8627e1da9b24373a1f90');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '3ebe0c48bc9928c08582');

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '6bce91817a063cdf476d');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '93055a99f1ccb0f58f0c');

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '4e25fbe50d772f6a1559');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => 'c025af2c653d2f67b7bb');

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '3f3755bbf3697bb808f8');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => 'b946c13aa5f4036e1a7e');

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '58f6f779c22873c960e8');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '1fe892d47aaf943f47cd');

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'f221373b7e38d2ff3d7c');
<?php return array('dependencies' => array(), 'version' => '84dce221de83bef91ccd');

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '6b2f02802534bd210435');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-server-side-render'), 'version' => '72187b6749d5a1e0dd7f');
Loading
Loading