Making WordPress.org


Ignore:
Timestamp:
07/22/2022 02:09:19 PM (4 years ago)
Author:
amieiro
Message:

Sync the gp-translation-helpers with GitHub, main branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php

    r11948 r11992  
    511511                        'comment_form_fields',
    512512                        function( $comment_fields ) {
    513                                 $comment_fields['comment'] = str_replace( '>Comment<', '>Please leave your comment about this string here:<', $comment_fields['comment'] );
     513                                $comment_fields['comment'] = str_replace( '</label>', ' (required)</label>', $comment_fields['comment'] );
    514514                                return $comment_fields;
    515515                        }
    … …  
    664664
    665665                $link = sprintf(
    666                         "<a rel='nofollow' class='comment-reply-link' href='%s' %s aria-label='%s'>%s</a>",
     666                        "<a rel='nofollow' class='comment-reply-link button is-primary' href='%s' %s aria-label='%s'>%s</a>",
    667667                        esc_url(
    668668                                add_query_arg(
    … …  
    719719
    720720        /**
    721          * Return an array of allowed rejection reasons
     721         * Return an array of allowed rejection reasons and explanation of each reason.
    722722         *
    723723         * @since 0.0.2
    … …  
    725725         * @return array
    726726         */
    727         public static function get_reject_reasons() {
     727        public static function get_reject_reasons(): array {
    728728                return array(
    729                         'style'       => __( 'Style Guide' ),
    730                         'grammar'     => __( 'Grammar' ),
    731                         'branding'    => __( 'Branding' ),
    732                         'glossary'    => __( 'Glossary' ),
    733                         'punctuation' => __( 'Punctuation' ),
    734                         'typo'        => __( 'Typo' ),
    735                 );
    736         }
    737 
     729                        'style'       => array(
     730                                'name'        => __( 'Style Guide' ),
     731                                'explanation' => __( 'The translation is not following the style guide. It will be interesting to provide a link to the style guide for your locale in the comment.' ),
     732                        ),
     733                        'grammar'     => array(
     734                                'name'        => __( 'Grammar' ),
     735                                'explanation' => __( 'The translation has some grammar problems. It will be interesting to provide a link explaining the grammar issue for your locale in the comment.' ),
     736                        ),
     737                        'branding'    => array(
     738                                'name'        => __( 'Branding' ),
     739                                'explanation' => __( 'The translation is using incorrectly some brand. E.g. WordPress without the capital P.' ),
     740                        ),
     741                        'glossary'    => array(
     742                                'name'        => __( 'Glossary' ),
     743                                'explanation' => __( 'The translation is not using the glossary correctly. It will be interesting to provide some link to the glossary for your locale in the comment.' ),
     744                        ),
     745                        'punctuation' => array(
     746                                'name'        => __( 'Punctuation' ),
     747                                'explanation' =>
     748                                        __( 'The translation is not using the punctuation marks correctly.' ),
     749                        ),
     750                        'typo'        => array(
     751                                'name'        => __( 'Typo' ),
     752                                'explanation' => __( 'The translation has a typo. E.g., it is using the \'apostrope\' word instead of \'apostrophe\'.' ),
     753                        ),
     754                );
     755        }
    738756}
    739757
    … …  
    869887                        <p>
    870888                                <?php echo esc_html( _n( 'Rejection Reason: ', 'Rejection Reasons: ', count( $reject_reason ) ) ); ?>
    871                                 <span><?php echo wp_kses( implode( '</span> | <span>', $reject_reason ), array( 'span' => array() ) ); ?></span>
     889                                <?php
     890                                $number_of_items = count( $reject_reason );
     891                                $counter         = 0;
     892                                $reject_reasons  = Helper_Translation_Discussion::get_reject_reasons();
     893                                foreach ( $reject_reason as $reason ) {
     894                                        echo wp_kses(
     895                                                sprintf(
     896                                                /* translators: 1: Title with the explanation of the reject reason , 2: The reject reason */
     897                                                        __( '<span title="%1$s" class="tooltip">%2$s</span> <span class="tooltip dashicons dashicons-info" title="%1$s"></span>', 'glotpress' ),
     898                                                        $reject_reasons[ $reason ]['explanation'],
     899                                                        $reject_reasons[ $reason ]['name'],
     900                                                ),
     901                                                array(
     902                                                        'span' => array(
     903                                                                'class' => array(),
     904                                                                'title' => array(),
     905                                                        ),
     906                                                )
     907                                        );
     908
     909                                        if ( ++$counter < $number_of_items ) {
     910                                                echo ', ';
     911                                        }
     912                                }
     913                                ?>
    872914                        </p>
    873915                        <?php endif; ?>
    … …  
    929971                                                        'title_reply_before'  => '<h5 id="reply-title" class="discuss-title">',
    930972                                                        'title_reply_after'   => '</h5>',
     973                                                        'comment_field'       => '<p class="">',
    931974                                                        'id_form'             => 'commentform-' . $comment->comment_post_ID,
    932975                                                        'cancel_reply_link'   => '<span></span>',
Note: See TracChangeset for help on using the changeset viewer.