HEX
Server: Apache/2
System: Linux ctr689471.novalocal 4.9.241-37.el7.x86_64 #1 SMP Mon Nov 2 13:55:04 UTC 2020 x86_64
User: bluecool (1005)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /home/bluecool/public_html/wp-content/plugins/loco-translate/src/api/Providers.php
<?php
/**
 * Third party API helpers
 */
abstract class Loco_api_Providers {


    /**
     * Export API credentials for all supported APIs
     * @return array[]
     */
    public static function export(){
        return apply_filters( 'loco_api_providers', self::builtin() );
    }
    
    
    /**
     * @return array[]
     */
    public static function builtin(){
        $settings = Loco_data_Settings::get();
        return array (
            array (
                'id' => 'deepl',
                'name' => 'DeepL Translator',
                'key' => $settings->offsetGet('deepl_api_key'),
            ),
            array (
                'id' => 'google',
                'name' => 'Google Translate',
                'key' => $settings->offsetGet('google_api_key'),
            ),
            array (
                'id' => 'microsoft',
                'name' => 'Microsoft Translator',
                'key' => $settings->offsetGet('microsoft_api_key'),
                'region' => $settings->offsetGet('microsoft_api_region'),
            ),
            array (
                'id' => 'yandex',
                'name' => 'Yandex.Translate',
                'key' => $settings->offsetGet('yandex_api_key'),
            ),
        );
    } 
    
}