Making WordPress.org

Changeset 13828

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

Translate: add a checkbox to be able to select the DeepL Pro API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/settings-edit.php

    r12660 r13828  
    4444$deepl_key      = trim( gp_array_get( $gp_default_sort, 'deepl_api_key' ) );
    4545$deepl_response = null;
     46
     47
     48
     49
    4650if ( $deepl_key ) {
    4751    $deepl_response = wp_remote_get(
    48         'https://api-free.deepl.com/v2/usage',
     52        ,
    4953        array(
    5054            'timeout' => 4,
     
    5660    );
    5761}
     62
    5863$deepl_response_code = wp_remote_retrieve_response_code( $deepl_response );
    5964?>
     
    181186        </th>
    182187    </tr>
     188
     189
     190
     191
    183192    <tr>
    184193        <th><label for="default_sort[deepl_api_key]">
    185                 <?php esc_html_e( 'DeepL Free API Key', 'glotpress' ); ?>
     194                <?php esc_html_e( 'DeepL API Key', 'glotpress' ); ?>
    186195            </label>
    187196                    <?php
     
    222231                if ( 200 != $deepl_response_code ) {
    223232                    echo '<small style="color:red;">';
    224                     esc_html_e( 'Your DeepL Free API Key is not correct.', 'glotpress' );
     233                    esc_html_e( 'Your DeepL API Key is not correct.', 'glotpress' );
    225234                } else {
    226235                    echo '<small style="color:green;">';
    227                     esc_html_e( 'Your DeepL Free API Key is correct.', 'glotpress' );
     236                    esc_html_e( 'Your DeepL API Key is correct.', 'glotpress' );
    228237                }
    229238                echo '</small>';
Note: See TracChangeset for help on using the changeset viewer.