Skip to content

Commit

Permalink
feat: add script translation support for all otter pro scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Dec 13, 2024
1 parent 49252e0 commit db13b9e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/otter-pro/inc/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ public function enqueue_block_editor_assets() {
$asset_file['version'],
true
);

wp_set_script_translations( 'otter-blocks-woocommerce', 'otter-pro' );
}
}

Expand All @@ -243,6 +245,8 @@ public function enqueue_options_assets() {
$asset_file['version'],
true
);

wp_set_script_translations( 'otter-dashboard-scripts', 'otter-pro' );
}

/**
Expand Down
3 changes: 3 additions & 0 deletions plugins/otter-pro/inc/plugins/class-live-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public static function load_deps() {
$asset_file['version'],
true
);

wp_localize_script(
'otter-live-search',
'liveSearchData',
Expand All @@ -105,6 +106,8 @@ public static function load_deps() {
)
);

wp_set_script_translations( 'otter-live-search', 'otter-pro' );

$asset_file = include OTTER_BLOCKS_PATH . '/build/blocks/live-search-style.asset.php';
wp_enqueue_style( 'otter-live-search-style', OTTER_BLOCKS_URL . 'build/blocks/live-search-style.css', $asset_file['dependencies'], $asset_file['version'] );
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/otter-pro/inc/plugins/class-woocommerce-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public function wc_get_template_part( $template, $slug, $name ) {

if ( has_block( 'themeisle-blocks/product-image', get_the_ID() ) ) {
wp_enqueue_script( 'wc-single-product' );

wp_set_script_translations( 'wc-single-product', 'otter-pro' );
}

if ( class_exists( '\Neve\Views\Product_Layout' ) && class_exists( '\Neve_Pro\Modules\Woocommerce_Booster\Views\Single_Product' ) ) {
Expand Down

0 comments on commit db13b9e

Please sign in to comment.