Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions includes/admin/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function hooks() {
$this->filter( 'action_scheduler_pastdue_actions_check_pre', 'as_exclude_pastdue_actions' );
$this->filter( 'rank_math/pro_badge', 'offer_icon' );
$this->filter( 'load_script_translation_file', 'load_script_translation_file', 10, 3 );
$this->filter( 'cmb2_localized_data', 'remap_cmb2_localized_data' );

// Use woocommerce textdomain for the Actiion scheduler strings.
$this->filter( 'gettext', 'remap_action_scheduler_translation', 10, 3 );
Expand Down Expand Up @@ -354,6 +355,28 @@ public function remap_action_scheduler_translation_with_context( $translated, $t
return $domain === 'action-scheduler' && Helper::is_woocommerce_active() ? _x( $text, $context, 'woocommerce' ) : $translated;
}

/**
* Remap CMB2 localized string text domain to Rank Math.
*
* @param array $localized_data Localized CMB2 data.
* @return array
*/
public function remap_cmb2_localized_data( $localized_data ) {
if ( empty( $localized_data['strings'] ) || ! is_array( $localized_data['strings'] ) ) {
return $localized_data;
}

$localized_data['strings']['upload_file'] = esc_html__( 'Use this file', 'rank-math' );
$localized_data['strings']['upload_files'] = esc_html__( 'Use these files', 'rank-math' );
$localized_data['strings']['remove_image'] = esc_html__( 'Remove Image', 'rank-math' );
$localized_data['strings']['remove_file'] = esc_html__( 'Remove', 'rank-math' );
$localized_data['strings']['file'] = esc_html__( 'File:', 'rank-math' );
$localized_data['strings']['download'] = esc_html__( 'Download', 'rank-math' );
$localized_data['strings']['check_toggle'] = esc_html__( 'Select / Deselect All', 'rank-math' );

return $localized_data;
}

/**
* Set term query.
*
Expand Down