Changeset 12405 for sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php
- Timestamp:
- 02/20/2023 02:50:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php
r12274 r12405 805 805 * @return array 806 806 */ 807 public static function get_comment_reasons( ): array {808 returnarray(807 public static function get_comment_reasons( $locale = null ): array { 808 $default_reasons = array( 809 809 'style' => array( 810 810 'name' => __( 'Style Guide' ), … … 825 825 'punctuation' => array( 826 826 'name' => __( 'Punctuation' ), 827 'explanation' => 828 __( 'The translation is not using the punctuation marks correctly.' ), 827 'explanation' => __( 'The translation is not using the punctuation marks correctly.' ), 829 828 ), 830 829 'typo' => array( … … 833 832 ), 834 833 ); 834 $reasons = apply_filters( 'gp_custom_reasons', $default_reasons, $locale ); 835 return $reasons; 835 836 } 836 837 } … … 898 899 $is_linking_comment = preg_match( '!^' . home_url( gp_url() ) . '[a-z0-9_/#-]+$!i', $comment->comment_content ); 899 900 900 $comment_locale = get_comment_meta( $comment->comment_ID, 'locale', true ); 901 $current_locale = $args['locale_slug']; 902 901 $comment_locale = get_comment_meta( $comment->comment_ID, 'locale', true ); 902 $current_locale = $args['locale_slug']; 903 903 $current_translation_id = $args['translation_id']; 904 904 $comment_translation_id = get_comment_meta( $comment->comment_ID, 'translation_id', true ); … … 960 960 if ( $comment_reason ) : 961 961 ?> 962 The translation <?php gth_print_translation( $comment_translation_id, $args ); ?> <a href="<?php echo esc_url( $linked_comment ); ?>"><?php esc_html_e( 'is being discussed here' ); ?></a>.962 <p>The translation <?php gth_print_translation( $comment_translation_id, $args ); ?> <a href="<?php echo esc_url( $linked_comment ); ?>"><?php esc_html_e( 'is being discussed here' ); ?></a>.</p> 963 963 <?php else : ?> 964 964 <a href="<?php echo esc_url( $linked_comment ); ?>"><?php esc_html_e( 'Please continue the discussion here' ); ?></a> … … 1037 1037 } 1038 1038 1039 if ( $comment_translation_id && $comment_translation_id !== $current_translation_id ) { 1040 $translation_status = ''; 1041 if ( $_translation_status ) { 1042 1043 $translation_status = ( is_array( $_translation_status ) && array_key_exists( $comment_translation_id, $_translation_status ) ) ? '(' . $_translation_status[ $comment_translation_id ] . ')' : ' (' . $_translation_status[0] . ')'; 1044 } 1045 gth_print_translation( $comment_translation_id, $args, 'Translation' . $translation_status . ': ' ); 1046 } 1039 1047 if ( ! $is_linking_comment ) : 1040 if ( $comment_translation_id && $comment_translation_id !== $current_translation_id ) {1041 $translation_status = '';1042 if ( $_translation_status ) {1043 $translation_status = ' (' . $_translation_status . ')';1044 }1045 gth_print_translation( $comment_translation_id, $args, 'Translation' . $translation_status . ': ' );1046 }1047 1048 1048 1049 ?>
Note: See TracChangeset
for help on using the changeset viewer.