Skip to content

Commit bfa054b

Browse files
committed
remove cron disable condition and add multilanguage nps
1 parent 5a87fda commit bfa054b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

assets/src/dashboard/parts/connected/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if ( 'undefined' !== typeof window && optimoleDashboardApp.user_data.plan ) {
3030
attributes: {
3131
plan: optimoleDashboardApp.user_data.plan,
3232
status: optimoleDashboardApp.user_data.status,
33+
language: optimoleDashboardApp.language,
3334
cname_assigned: optimoleDashboardApp.user_data.is_cname_assigned || 'no',
3435
connected_websites: optimoleDashboardApp.user_data.whitelist.length,
3536
traffic: convertToCategory( optimoleDashboardApp.user_data.traffic, 500 ),

inc/admin.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,8 +1197,15 @@ private function localize_dashboard_app() {
11971197
$routes[ $route ] = OPTML_NAMESPACE . '/v1/' . $route;
11981198
}
11991199
}
1200-
1201-
$cron_disabled = apply_filters( 'optml_offload_wp_cron_disabled', defined( 'DISABLE_WP_CRON' ) && constant( 'DISABLE_WP_CRON' ) === true );
1200+
// Disable this for now, we need a better way to detect it.
1201+
// $cron_disabled = apply_filters( 'optml_offload_wp_cron_disabled', defined( 'DISABLE_WP_CRON' ) && constant( 'DISABLE_WP_CRON' ) === true );
1202+
$cron_disabled = false;
1203+
$language = get_user_locale();
1204+
$available_languages = [
1205+
'de_DE' => 'de',
1206+
'de_DE_formal' => 'de',
1207+
];
1208+
$lang_code = isset( $available_languages[ $language ] ) ? 'de' : 'en';
12021209

12031210
return [
12041211
'strings' => $this->get_dashboard_strings(),
@@ -1210,6 +1217,7 @@ private function localize_dashboard_app() {
12101217
'available_apps' => $available_apps,
12111218
'api_key' => $api_key,
12121219
'routes' => $routes,
1220+
'language' => $lang_code,
12131221
'nonce' => wp_create_nonce( 'wp_rest' ),
12141222
'user_data' => $service_data,
12151223
'remove_latest_images' => defined( 'OPTML_REMOVE_LATEST_IMAGES' ) && constant( 'OPTML_REMOVE_LATEST_IMAGES' ) ? ( OPTML_REMOVE_LATEST_IMAGES ? 'yes' : 'no' ) : 'no',

0 commit comments

Comments
 (0)