File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
assets/src/dashboard/parts/connected Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ if ( 'undefined' !== typeof window && optimoleDashboardApp.user_data.plan ) {
30
30
attributes : {
31
31
plan : optimoleDashboardApp . user_data . plan ,
32
32
status : optimoleDashboardApp . user_data . status ,
33
+ language : optimoleDashboardApp . language ,
33
34
cname_assigned : optimoleDashboardApp . user_data . is_cname_assigned || 'no' ,
34
35
connected_websites : optimoleDashboardApp . user_data . whitelist . length ,
35
36
traffic : convertToCategory ( optimoleDashboardApp . user_data . traffic , 500 ) ,
Original file line number Diff line number Diff line change @@ -1197,8 +1197,15 @@ private function localize_dashboard_app() {
1197
1197
$ routes [ $ route ] = OPTML_NAMESPACE . '/v1/ ' . $ route ;
1198
1198
}
1199
1199
}
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 ' ;
1202
1209
1203
1210
return [
1204
1211
'strings ' => $ this ->get_dashboard_strings (),
@@ -1210,6 +1217,7 @@ private function localize_dashboard_app() {
1210
1217
'available_apps ' => $ available_apps ,
1211
1218
'api_key ' => $ api_key ,
1212
1219
'routes ' => $ routes ,
1220
+ 'language ' => $ lang_code ,
1213
1221
'nonce ' => wp_create_nonce ( 'wp_rest ' ),
1214
1222
'user_data ' => $ service_data ,
1215
1223
'remove_latest_images ' => defined ( 'OPTML_REMOVE_LATEST_IMAGES ' ) && constant ( 'OPTML_REMOVE_LATEST_IMAGES ' ) ? ( OPTML_REMOVE_LATEST_IMAGES ? 'yes ' : 'no ' ) : 'no ' ,
You can’t perform that action at this time.
0 commit comments