Making WordPress.org


Ignore:
Timestamp:
05/08/2019 04:48:37 PM (5 years ago)
Author:
ocean90
Message:

Translate: Include slug of translation set in locale when querying the translation memory for results.

See #4430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/routes/class-translation-memory.php

    r8732 r8749  
    1010class Translation_Memory extends GP_Route {
    1111
    12     public function get_suggestions( $project_path, $locale_slug ) {
     12    public function get_suggestions( $project_path, $locale_slug, $set_slug ) {
    1313        $original_id = gp_get( 'original' );
    1414        $nonce       = gp_get( 'nonce' );
     
    2727        }
    2828
    29         $suggestions = Translation_Memory_Client::query( $original->singular, $locale_slug );
     29        $locale = $locale_slug;
     30        if ( 'default' !== $set_slug ) {
     31            $locale .= '_' . $set_slug;
     32        }
     33
     34        $suggestions = Translation_Memory_Client::query( $original->singular, $locale );
    3035
    3136        if ( is_wp_error( $suggestions ) ) {
     
    3641    }
    3742}
     43
Note: See TracChangeset for help on using the changeset viewer.