Making WordPress.org


Ignore:
Timestamp:
04/12/2022 06:52:51 PM (4 years ago)
Author:
ocean90
Message:

Translate: Update Slack notifications for #meta-language-packs.

  • Include project type in notifications for translation syncs.
  • Exclude lines for sets without any translations when building new language packs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-theme-directory/inc/language-pack/class-build-listener.php

    r8156 r11768  
    4747
    4848                // Build in a separate process.
    49                 $cmd = WPORGTRANSLATE_WPCLI . ' wporg-translate language-pack generate theme ' . escapeshellarg( $args['theme'] ) . ' 2>&1';
     49                $cmd        = WPORGTRANSLATE_WPCLI . ' wporg-translate language-pack generate theme ' . escapeshellarg( $args['theme'] ) . ' 2>&1';
     50                $output     = [];
     51                $return_var = 0;
    5052                exec( $cmd, $output, $return_var );
     53                $output = array_filter( $output, fn( $line ) => ! str_ends_with( $line, ', no translations.' ) );
    5154                if ( $return_var ) {
    52                         $message .= "\tFailure: " . implode( "\n\t", $output ) . "\n";
     55                        $message .= 'Failure: ' . implode( "\n", $output ) . "\n";
    5356                } else {
    54                         $message .= "\t" . implode( "\n\t", $output ) . "\n";
     57                        $message .= implode( "\n", $output ) . "\n";
    5558                }
    5659
    57                 $message .= "Language packs for {$args['theme']} processed.\n";
     60                $message = trim( $message );
     61                if ( ! $message ) {
     62                        $message = "No language packs for {$args['theme']} generated.";
     63                }
    5864
    5965                $attachment = [
Note: See TracChangeset for help on using the changeset viewer.