Making WordPress.org

Changeset 12400


Ignore:
Timestamp:
02/17/2023 02:40:05 PM (20 months ago)
Author:
spiraltee
Message:

Translate: Sync fuzzy, rejected and changes requested translations in both dev and stable versions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php

    r11771 r12400  
    136136        global $wpdb;
    137137
    138         // Only propagate current translations without warnings.
    139         if ( 'current' !== $translation->status || ! empty( $translation->warnings ) ) {
     138        $allowed_statuses = array( "current", "rejected", "changesrequested", "fuzzy" );
     139       
     140        // Do not propagate waiting translations and other translations with warnings.
     141        if ( ! in_array( $translation->status, $allowed_statuses ) || ! empty( $translation->warnings ) ) {
    140142            return;
    141143        }
     
    259261        $copy->original_id = $new_original->id;
    260262        $copy->translation_set_id = $new_translation_set->id;
    261         $copy->status = 'current';
     263        $copy->status = $translation->status;
    262264
    263265        $translation = GP::$translation->create( $copy );
     
    266268        }
    267269
    268         $translation->set_as_current();
     270        do_action( 'wporg_translate_translation_synced', $copy, $translation );
     271
     272        $translation->set_status($copy->status);
    269273        gp_clean_translation_set_cache( $new_translation_set->id );
    270274
Note: See TracChangeset for help on using the changeset viewer.