! empty( $eshb_settings['cart-blocking-switcher'] ) ? '1' : '0', 'msg' => $eshb_notice_msg, ] ); wp_localize_script('eshb-public-script', 'eshb_rest', [ 'root' => esc_url(rest_url()), 'nonce' => wp_create_nonce('wp_rest') ]); // Prepare translations dynamically based on current locale $translations = [ 'applyLabel' => !empty($apply_text_default) ? eshb_get_translated_string($apply_text_default) : __('Apply', 'easy-hotel'), 'cancelLabel' => !empty($cancel_text_default) ? eshb_get_translated_string($cancel_text_default) : __('Cancel', 'easy-hotel'), 'BookedTooltip' => __('Already Booked!', 'easy-hotel'), 'holidayTooltip' => __('This is Holiday!', 'easy-hotel'), 'fromLabel' => __('From', 'easy-hotel'), 'toLabel' => __('To', 'easy-hotel'), 'customRangeLabel' => __('Custom Range', 'easy-hotel'), 'weekLabel' => __('W', 'easy-hotel'), 'firstDay' => get_option('start_of_week'), // Get WordPress's start of the week setting 'currentLocale' => $locale, // Pass current locale for debugging or further use ]; // Pass translations to JavaScript wp_localize_script('eshb-date-range-picker-js', 'eshb_daterangepicker_i18n', $translations); }