Changeset 12765
- Timestamp:
- 07/28/2023 03:17:38 PM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions
- Files:
-
- 3 edited
-
js/translation-suggestions.js (modified) (1 diff)
-
templates/other-languages-suggestions.php (modified) (1 diff)
-
templates/translation-memory-suggestions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js
r12751 r12765 479 479 return; 480 480 } 481 externalSuggestion.suggestion_source = $row.data( 'suggestion-source' ) == 'translation' ? 'tm' : $row.data( 'suggestion-source' ); 482 externalSuggestion.translation = $row.find( '.translation-suggestion__translation' ).text(); 483 481 if ( $row.data( 'suggestion-locale' ) ) { 482 externalSuggestion.suggestion_source = $row.data( 'suggestion-locale' ); 483 externalSuggestion.translation = $row.find( '.translation-suggestion__translation-raw' ).text(); 484 } else { 485 externalSuggestion.suggestion_source = $row.data( 'suggestion-source' ); 486 externalSuggestion.translation = $row.find( '.translation-suggestion__translation' ).text(); 487 } 484 488 } 485 489 486 490 //Prefilter ajax requests to add external translations used to the request. 487 491 $.ajaxPrefilter( function ( options ) { 488 const isSuggestionUsed = Object.keys( externalSuggestion ).length > 0 ? true : false; 489 490 if ( ! externalSuggestion || ! isSuggestionUsed ) { 492 if ( ! externalSuggestion || ! externalSuggestion.suggestion_source || ! externalSuggestion.translation ) { 491 493 return; 492 494 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/templates/other-languages-suggestions.php
r11732 r12765 7 7 foreach ( $suggestions as $suggestion ) { 8 8 echo '<li>'; 9 echo '<div class="translation-suggestion with-tooltip" tabindex="0" role="button" aria-pressed="false" aria-label="Copy translation">';9 echo '<div class="translation-suggestion with-tooltip" tabindex="0" role="button" data-suggestion-locale="' . esc_html( strtolower( $suggestion['locale'] ) ) . '" aria-pressed="false" aria-label="Copy translation">'; 10 10 11 11 echo '<span class="translation-suggestion__translation">'; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/templates/translation-memory-suggestions.php
r12751 r12765 5 5 echo '<ul class="suggestions-list">'; 6 6 foreach ( $suggestions as $suggestion ) { 7 $suggestion_type = ( 'translation' === strtolower( $type ) ) ? 'tm' : $type; 8 7 9 echo '<li>'; 8 echo '<div class="translation-suggestion with-tooltip ' . esc_html( strtolower( $type ) ) . '" tabindex="0" data-suggestion-source="' . esc_html( strtolower( $ type ) ) . '" role="button" aria-pressed="false" aria-label="Copy translation">';10 echo '<div class="translation-suggestion with-tooltip ' . esc_html( strtolower( $type ) ) . '" tabindex="0" data-suggestion-source="' . esc_html( strtolower( $suggestion_type ) ) . '" role="button" aria-pressed="false" aria-label="Copy translation">'; 9 11 echo '<span class="' . esc_html( strtolower( $type ) ) . '-suggestion__score">'; 10 12 if ( 'Translation' == $type ) {
Note: See TracChangeset
for help on using the changeset viewer.