Skip to content

Commit

Permalink
chore: fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
abaicus committed Jul 30, 2024
2 parents bfd5209 + 47e6614 commit fecc5b6
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 31 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function() {
'is_enabled' => ! defined( 'NEVE_PRO_VERSION' ),
'pro_name' => 'Neve Pro Addon',
'logo' => get_template_directory_uri() . '/assets/img/dashboard/logo.svg',
'cta_link' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/?discount=LOYALUSER582&dvalue=50', 'neve-welcome', 'notice' ),
'cta_link' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/?discount=LOYALUSER582&dvalue=50', 'neve-welcome', 'notice' ), 'query' ),
];
}
);
Expand Down
4 changes: 2 additions & 2 deletions header-footer-grid/Core/Builder/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function init() {
'footer_copyright_content' => array(
'label' => esc_html__( 'Change Copyright', 'neve' ),
'icon' => 'dashicons-nametag',
'url' => $this->has_valid_addons() ? null : tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyright' ),
'url' => $this->has_valid_addons() ? null : tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyright' ), 'query' ),
),
'hfg_footer_layout_bottom_background' => array(
'label' => esc_html__( 'Change Footer Color', 'neve' ),
Expand Down Expand Up @@ -156,7 +156,7 @@ public function add_footer_component( $builder, $row, $slot ) {
$output .= sprintf(
/* translators: %1$s is Theme Name ( Neve ), %2$s is WordPress */
esc_html__( '%1$s | Powered by %2$s', 'neve' ),
wp_kses_post( '<p><a href="https://themeisle.com/themes/neve/" rel="nofollow">Neve</a>' ),
wp_kses_post( '<p><a href="' . tsdk_translate_link( 'https://themeisle.com/themes/neve/', 'path' ) . '" rel="nofollow">Neve</a>' ),
wp_kses_post( '<a href="https://wordpress.org" rel="nofollow">WordPress</a></p>' )
);
$output .= '</div></div></div></div>';
Expand Down
16 changes: 8 additions & 8 deletions inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function () use ( $filtered_name ) {
// Add predefined product pages to the about page.
'product_pages' => [ 'otter-page' ],
// Upgrade menu item link & text
'upgrade_link' => tsdk_utmify( esc_url( 'https://themeisle.com/themes/neve/upgrade/' ), 'aboutfilter', 'nevedashboard' ),
'upgrade_link' => tsdk_translate_link( tsdk_utmify( esc_url( 'https://themeisle.com/themes/neve/upgrade/' ), 'aboutfilter', 'nevedashboard' ), 'query' ),
'upgrade_text' => __( 'Upgrade', 'neve' ) . ' ' . $filtered_name,
];
}
Expand Down Expand Up @@ -299,7 +299,7 @@ public function enqueue() {

$build_path = get_template_directory_uri() . '/assets/apps/dashboard/build/';
$dependencies = ( include get_template_directory() . '/assets/apps/dashboard/build/dashboard.asset.php' );

wp_register_style( 'neve-dash-style', $build_path . 'style-dashboard.css', [ 'wp-components', 'neve-components' ], $dependencies['version'] );
wp_style_add_data( 'neve-dash-style', 'rtl', 'replace' );
wp_enqueue_style( 'neve-dash-style' );
Expand Down Expand Up @@ -339,10 +339,10 @@ private function get_localization() {
'plugins' => $this->get_useful_plugins(),
'featureData' => $this->get_free_pro_features(),
'showFeedbackNotice' => $this->should_show_feedback_notice(),
'allfeaturesNeveProURL' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'seeallfeatures', 'freevspropage' ),
'startSitesgetNeveProURL' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'welcomestartersitescard', 'nevedashboard' ),
'customLayoutsNeveProURL' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'customlayoutscard', 'nevedashboard' ),
'upgradeURL' => apply_filters( 'neve_upgrade_link_from_child_theme_filter', tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'getpronow', 'freevspropage' ) ),
'allfeaturesNeveProURL' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'seeallfeatures', 'freevspropage' ), 'query' ),
'startSitesgetNeveProURL' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'welcomestartersitescard', 'nevedashboard' ), 'query' ),
'customLayoutsNeveProURL' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'customlayoutscard', 'nevedashboard' ), 'query' ),
'upgradeURL' => apply_filters( 'neve_upgrade_link_from_child_theme_filter', tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'getpronow', 'freevspropage' ), 'query' ) ),
'supportURL' => esc_url( 'https://wordpress.org/support/theme/neve/' ),
'docsURL' => esc_url( 'https://docs.themeisle.com/article/946-neve-doc' ),
'codexURL' => esc_url( 'https://codex.nevewp.com/' ),
Expand Down Expand Up @@ -371,7 +371,7 @@ private function get_localization() {
'licenseCardDescription' => sprintf(
// translators: store name (Themeisle)
__( 'Enter your license from %1$s purchase history in order to get plugin updates', 'neve' ),
'<a target="_blank" rel="external noreferrer noopener" href="https://store.themeisle.com/">ThemeIsle<span class="components-visually-hidden">' . esc_html__( '(opens in a new tab)', 'neve' ) . '</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" class="components-external-link__icon" role="img" aria-hidden="true" focusable="false" style="fill: #0073AA"><path d="M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"></path></svg></a>'
'<a target="_blank" rel="external noreferrer noopener" href="' . tsdk_translate_link( 'https://store.themeisle.com/', 'query' ) . '">ThemeIsle<span class="components-visually-hidden">' . esc_html__( '(opens in a new tab)', 'neve' ) . '</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" class="components-external-link__icon" role="img" aria-hidden="true" focusable="false" style="fill: #0073AA"><path d="M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"></path></svg></a>'
),
],
'changelog' => $this->cl_handler->get_changelog( get_template_directory() . '/CHANGELOG.md' ),
Expand Down Expand Up @@ -470,7 +470,7 @@ public function get_notifications() {
__( 'From 3.3.0 we decided to remove the copyright component from the free version. You can continue using it if you rollback to 3.2.x or you can upgrade to pro, using a one time 50%% discount: %s', 'neve' ),
wp_kses_post( '<code>NEVEBRANDING50</code>' )
),
'url' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyrightnotice', 'nevedashboard' ),
'url' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyrightnotice', 'nevedashboard' ), 'query' ),
'targetBlank' => true,
'cta' => __( 'Upgrade', 'neve' ),
];
Expand Down
2 changes: 1 addition & 1 deletion inc/admin/hooks_upsells.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function () use ( $hook_value, $hook_label, $upsell_label ) {
if ( 'woocommerce_before_shop_loop_item' === $hook_value ) {
$style = 'max-width: 200px;';
}
$upsell_url = tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'viewhooks' );
$upsell_url = tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'viewhooks' ), 'query' );
echo '<div class="nv-hook-wrapper nv-hook-upsell-wrapper">';
echo '<div class="nv-hook-placeholder">';
echo '<a href="' . esc_url( $upsell_url ) . '" title="' . esc_attr( $upsell_label ) . '" target="_blank">';
Expand Down
1 change: 1 addition & 0 deletions inc/core/core_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ function () {
add_action( 'wp_enqueue_scripts', array( $front_end, 'enqueue_scripts' ) );
add_action( 'after_setup_theme', array( $front_end, 'setup_theme' ) );
add_action( 'widgets_init', array( $front_end, 'register_sidebars' ) );
add_filter( 'load_script_translation_file', array( $front_end, 'fix_script_translation_files' ), 10, 3 );
}

/**
Expand Down
25 changes: 25 additions & 0 deletions inc/core/front_end.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,29 @@ public function css_global_custom_colors( $current_styles, $context ) {

return $current_styles;
}

/**
* Fix script translations language directory.
*
* @param string | false $file File path.
* @param string $handle Script handle.
* @param string $domain Script text domain.
*
* @return string | false
*/
public function fix_script_translation_files( $file, $handle, $domain ) {
if ( ! $file || $domain !== 'neve' ) {
return $file;
}

if ( is_file( $file ) ) {
return $file;
}

if ( strpos( $file, WP_LANG_DIR . '/plugins' ) !== false ) {
$file = str_replace( WP_LANG_DIR . '/plugins', WP_LANG_DIR . '/themes', $file );
}

return $file;
}
}
6 changes: 3 additions & 3 deletions inc/customizer/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function enqueue_customizer_controls() {
'controls' => array(),
'options' => array(),
),
'upsellComponentsLink' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'hfgcomponents' ),
'upsellComponentsLink' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'hfgcomponents' ), 'query' ),
'fonts' => array(
'System' => neve_get_standard_fonts(),
'Google' => neve_get_google_fonts(),
Expand Down Expand Up @@ -168,11 +168,11 @@ public function enqueue_customizer_controls() {

if ( isset( $dependencies['chunks'] ) ) {
foreach ( $dependencies['chunks'] as $chunk_file ) {

$chunk_handle = 'neve-customizer-chunk-' . $chunk_file;
wp_register_script( $chunk_handle, $bundle_path . $chunk_file, [], $dependencies['version'], true );
wp_enqueue_script( $chunk_handle );

if ( function_exists( 'wp_set_script_translations' ) ) {
wp_set_script_translations( $chunk_handle, 'neve' );
}
Expand Down
Loading

0 comments on commit fecc5b6

Please sign in to comment.