Skip to content

Commit edb78a7

Browse files
authored
Merge pull request #4452 from Codeinwp/fix/translation-string
refactor: update strings
2 parents 1667e82 + 3bc938a commit edb78a7

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

assets/apps/dashboard/src/Components/Content/AvailableModule.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* global neveDash */
2-
import { __, sprintf } from '@wordpress/i18n';
2+
import { __ } from '@wordpress/i18n';
33
import {
44
NEVE_AVAILABLE_MODULES_ICON_MAP,
55
NEVE_STORE,
@@ -42,10 +42,8 @@ const ModuleToggle = ({
4242
const { api } = neveDash;
4343
const { title } = moduleData;
4444
const toastMessage = {
45-
//translators: %s - Plugin name
46-
installing: sprintf(__('Installing %s', 'neve'), 'Orbit Fox Plugin'),
47-
//translators: %s - Plugin name
48-
activating: sprintf(__('Activating %s', 'neve'), 'Orbit Fox Plugin'),
45+
installing: __('Installing', 'neve'),
46+
activating: __('Activating', 'neve'),
4947
};
5048

5149
const handleToggle = async (value) => {
@@ -90,7 +88,10 @@ const ModuleToggle = ({
9088
);
9189
} catch (error) {
9290
setToast(
93-
__('Something went wrong while activating the module.', 'neve')
91+
__(
92+
'Something went wrong. Please reload the page and try again.',
93+
'neve'
94+
)
9495
);
9596
} finally {
9697
setLoading(false);
@@ -154,7 +155,7 @@ const AvailableModuleCard = ({
154155
className="flex mt-2 text-blue-600 gap-2 align-middle"
155156
href="admin.php?page=obfx_companion"
156157
>
157-
{__('Go to Settings to Edit', 'neve')}
158+
{__('Settings', 'neve')}
158159
<ArrowRight size={18} />
159160
</a>
160161
)}

inc/core/admin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public function activate_plugin( $request ) {
402402
}
403403

404404
if ( ! isset( $api->download_link ) ) {
405-
wp_send_json_error( array( 'message' => __( 'Invalid plugin information.', 'neve' ) ) );
405+
wp_send_json_error( array( 'message' => __( 'Invalid action', 'neve' ) ) );
406406
}
407407

408408
$skin = new \WP_Ajax_Upgrader_Skin();
@@ -461,12 +461,12 @@ public function activate_module( $request ) {
461461
$modules = $settings::$instance->module_objects;
462462

463463
if ( ! isset( $modules[ $module_slug ] ) ) {
464-
wp_send_json_error( __( 'Invalid module slug.', 'neve' ) );
464+
wp_send_json_error( __( 'Invalid action', 'neve' ) );
465465
}
466466

467467
$response = $modules[ $module_slug ]->set_status( 'active', $module_value );
468468

469-
wp_send_json_success( __( 'Module status changed.', 'neve' ) );
469+
wp_send_json_success( $module_value ? __( 'Module Activated', 'neve' ) : __( 'Module Deactivated.', 'neve' ) );
470470
}
471471

472472
/**

0 commit comments

Comments
 (0)