Changeset 14582
- Timestamp:
- 10/30/2025 11:04:28 AM (3 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions
- Files:
-
- 2 edited
-
inc/class-plugin.php (modified) (4 diffs)
-
js/translation-suggestions.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/class-plugin.php
r12873 r14582 6 6 use GP_Locales; 7 7 use WordPressdotorg\GlotPress\TranslationSuggestions\Routes\Translation_Memory; 8 use WordPressdotorg\GlotPress\Bulk_Pretranslations\Deepl; 8 9 9 10 class Plugin { … … 131 132 $get_openai_translations = ! empty( trim( gp_array_get( $gp_default_sort, 'openai_api_key' ) ) ); 132 133 $get_deepl_translations = ! empty( trim( gp_array_get( $gp_default_sort, 'deepl_api_key' ) ) ); 133 134 $deepl = new DeepL(); 135 $deepl_locale = $deepl->get_deepl_locale( $args['locale_slug'] ); 136 134 137 wp_localize_script( 135 138 'gp-translation-suggestions', … … 140 143 'get_openai_translations' => $get_openai_translations, 141 144 'get_deepl_translations' => $get_deepl_translations, 145 'get_deepl_locale' => $deepl_locale, 142 146 ), 143 147 ) … … 145 149 146 150 gp_enqueue_script( 'gp-translation-suggestions' ); 147 148 151 wp_add_inline_script( 149 152 'gp-translation-suggestions', -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js
r13763 r14582 308 308 **/ 309 309 function maybeFetchDeeplSuggestions( editor ) { 310 // If the locale is not supported, do not fetch suggestions. 311 if ( "" === gpTranslationSuggestions.get_external_translations.get_deepl_locale ) { 312 return; 313 } 310 314 maybeFetchExternalSuggestions( editor, 'DeepL', gpTranslationSuggestions.get_external_translations.get_deepl_translations, window.WPORG_TRANSLATION_MEMORY_DEEPL_API_URL ); 311 315 }
Note: See TracChangeset
for help on using the changeset viewer.