Making WordPress.org

Changeset 13827

Timestamp:
06/17/2024 09:43:46 AM (7 weeks ago)
Author:
amieiro
Message:

Translate: use the DeepL Pro API if the user has checked the option

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

    r12829 r13827  
    278278     */
    279279    private function get_deepl_suggestion( string $original_singular, string $locale, string $set_slug ): array {
    280         $free_url        = 'https://api-free.deepl.com/v2/translate';
    281280        $gp_default_sort = get_user_option( 'gp_default_sort' );
    282281        $deepl_api_key   = gp_array_get( $gp_default_sort, 'deepl_api_key' );
     282
     283
     284
    283285        if ( empty( trim( $deepl_api_key ) ) ) {
    284286            return array();
     
    292294        }
    293295        $deepl_response = wp_remote_post(
    294             $free_url,
     296            $_url,
    295297            array(
    296298                'timeout' => 20,
Note: See TracChangeset for help on using the changeset viewer.