Making WordPress.org

Changeset 14209


Ignore:
Timestamp:
11/26/2024 06:39:00 PM (3 months ago)
Author:
amieiro
Message:

Translate: In the bulk pretranslation, add a link to the waiting strings in the toast

File:
1 edited

Legend:

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

    r14205 r14209  
    126126            }
    127127        }
     128
    128129        $this->set_notice( $pretranslations_added );
    129130    }
     
    155156     *
    156157     * @param int $pretranslations_added The number of pre-translations added.
     158     *
     159     * @return void
    157160     */
    158161    private function set_notice( int $pretranslations_added ):void {
    159162        $notice = sprintf(
    160163        /* translators: %s: Pretranslations count. */
    161             _n( '%s pretranslation was added', '%s pretranslations were added', $pretranslations_added, 'glotpress' ),
     164            _n( '%s pretranslation was added.', '%s pretranslations were added.', $pretranslations_added, 'wporg-gp-bulk-pretranslations' ),
    162165            $pretranslations_added
    163166        );
     167        if ( $pretranslations_added > 0 ) {
     168            $current_url = str_replace( '-bulk/', '', gp_url_current() );
     169            $waiting_url = add_query_arg( 'filters[status]', 'waiting', $current_url );
     170
     171            $notice .= '<br>';
     172            $notice .= wp_kses(
     173                sprintf(
     174                _n( "You can see it in <a href=\"%s\">waiting</a> status.",
     175                    "You can see them in <a href=\"%s\">waiting</a> status.",
     176                    $pretranslations_added,
     177                    'wporg-gp-bulk-pretranslations' ),
     178                $waiting_url,
     179            ),
     180                array( 'a' => array( 'href' => array() ) )
     181            );
     182        }
    164183        gp_notice_set( $notice );
    165184    }
Note: See TracChangeset for help on using the changeset viewer.