From 2b15a47aea591e452d94ce8680f65d83338651e7 Mon Sep 17 00:00:00 2001 From: Namith Jawahar <48271037+namithj@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:26:01 +0530 Subject: [PATCH] #128 Make the API Key Error Translatable (#131) 1) #128 Make the API Key Error Translatable 2) Coding Standards auto update, this should stop once one of the newer PRs are merged. --- assets/js/aspire-update.js | 2 +- includes/class-admin-settings.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/aspire-update.js b/assets/js/aspire-update.js index e9f9f42..dd6e76e 100644 --- a/assets/js/aspire-update.js +++ b/assets/js/aspire-update.js @@ -150,7 +150,7 @@ class ApiRewrites { if ((response.status === 400) || (response.status === 401)) { ApiRewrites.api_key.show_error(response.responseJSON?.error); } else { - ApiRewrites.api_key.show_error('Unexpected Error: ' + response.status); + ApiRewrites.api_key.show_error(aspireupdate.string_unexpected_error + ' ' + response.status); } }); }, diff --git a/includes/class-admin-settings.php b/includes/class-admin-settings.php index fe29840..e3bccb9 100644 --- a/includes/class-admin-settings.php +++ b/includes/class-admin-settings.php @@ -288,10 +288,10 @@ public function admin_enqueue_scripts( $hook ) { 'aspire_update_settings_js', 'aspireupdate', [ - - 'ajax_url' => network_admin_url( 'admin-ajax.php' ), - 'nonce' => wp_create_nonce( 'aspireupdate-ajax' ), - 'domain' => Utilities::get_top_level_domain(), + 'ajax_url' => network_admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( 'aspireupdate-ajax' ), + 'domain' => Utilities::get_top_level_domain(), + 'string_unexpected_error' => esc_html__( 'Unexpected Error:', 'AspireUpdate' ), ] ); }