From 8201369f5cc30bb76f4b91a6ff62ff3b2c457ecb Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Mon, 1 Dec 2025 11:42:45 +0530 Subject: [PATCH 1/4] refactor: translatable strings --- css/settings.css | 3 - feedzy-rss-feed.php | 29 +++++++++ includes/admin/feedzy-rss-feeds-admin.php | 2 +- includes/admin/feedzy-rss-feeds-import.php | 62 +++++++++++++++---- includes/admin/feedzy-rss-feeds-ui-lang.php | 30 +++------ includes/admin/feedzy-rss-feeds-ui.php | 2 +- .../elementor/widgets/register-widget.php | 6 +- includes/layouts/feedzy-improve.php | 5 +- includes/layouts/feedzy-pro.php | 45 +++++++------- includes/layouts/feedzy-schedules.php | 6 +- includes/layouts/setup-wizard.php | 15 +++-- .../views/amazon-product-advertising-view.php | 2 +- includes/views/import-metabox-edit.php | 27 +++++--- includes/views/openai-view.php | 2 +- includes/views/openrouter-view.php | 2 +- includes/views/spinnerchief-view.php | 2 +- includes/views/wordai-view.php | 4 +- js/FeedzyBlock/Editor.js | 56 +++++++++++------ js/FeedzyBlock/inspector.js | 62 ++++++++++--------- js/FeedzyLoop/controls.js | 38 +++++++----- js/FeedzyLoop/placeholder.js | 28 +++++---- readme.txt | 6 +- 22 files changed, 268 insertions(+), 166 deletions(-) diff --git a/css/settings.css b/css/settings.css index f4a89a5d6..a06db8309 100644 --- a/css/settings.css +++ b/css/settings.css @@ -835,7 +835,6 @@ input.fz-switch-toggle[type=checkbox]:checked:before{ outline: 0; cursor: pointer; text-decoration: none; - text-transform: capitalize; -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; @@ -1564,7 +1563,6 @@ input.fz-switch-toggle[type=checkbox]:checked:before{ background: transparent; border-color: #4268CF; color: #4268CF; - text-transform: capitalize; -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; @@ -2250,7 +2248,6 @@ li.draggable-item .components-panel__body-toggle.components-button{ } .fz-content-action div .tagify__tag-text { padding-right: 10px; - text-transform: capitalize; } .popover-action-list ul li.fz-action-disabled { cursor: not-allowed !important; diff --git a/feedzy-rss-feed.php b/feedzy-rss-feed.php index 63ca97ceb..77839ee48 100644 --- a/feedzy-rss-feed.php +++ b/feedzy-rss-feed.php @@ -324,6 +324,35 @@ function ( $labels ) { ); } + if ( isset( $labels['about_us'] ) ) { + $labels['about_us'] = array_merge( + $labels['about_us'], + array( + 'title' => __( 'About Us', 'feedzy-rss-feeds' ), + 'heroHeader' => __( 'Our Story', 'feedzy-rss-feeds' ), + 'heroTextFirst' => __( 'Themeisle was founded in 2012 by a group of passionate developers who wanted to create beautiful and functional WordPress themes and plugins. Since then, we have grown into a team of over 20 dedicated professionals who are committed to delivering the best possible products to our customers.', 'feedzy-rss-feeds' ), + 'heroTextSecond' => __( 'At Themeisle, we offer a wide range of WordPress themes and plugins that are designed to meet the needs of both beginners and advanced users. Our products are feature-rich, easy to use, and are designed to help you create beautiful and functional websites.', 'feedzy-rss-feeds' ), + 'teamImageCaption' => __( 'Our team in WCEU2022 in Portugal', 'feedzy-rss-feeds' ), + 'newsHeading' => __( 'Stay connected for news & updates!', 'feedzy-rss-feeds' ), + 'emailPlaceholder' => __( 'Your email address', 'feedzy-rss-feeds' ), + 'signMeUp' => __( 'Sign me up', 'feedzy-rss-feeds' ), + 'installNow' => __( 'Install Now', 'feedzy-rss-feeds' ), + 'activate' => __( 'Activate', 'feedzy-rss-feeds' ), + 'learnMore' => __( 'Learn More', 'feedzy-rss-feeds' ), + 'installed' => __( 'Installed', 'feedzy-rss-feeds' ), + 'notInstalled' => __( 'Not Installed', 'feedzy-rss-feeds' ), + 'active' => __( 'Active', 'feedzy-rss-feeds' ), + 'others' => array( + 'optimole_desc' => __( 'Optimole is an image optimization service that automatically optimizes your images and serves them to your visitors via a global CDN, making your website lighter, faster and helping you reduce your bandwidth usage.', 'feedzy-rss-feeds' ), + 'neve_desc' => __( 'A fast, lightweight, customizable WordPress theme offering responsive design, speed, and flexibility for various website types.', 'feedzy-rss-feeds' ), + 'landingkit_desc' => __( 'Turn WordPress into a landing page powerhouse with Landing Kit, map domains to pages or any other published resource.', 'feedzy-rss-feeds' ), + 'sparks_desc' => __( 'Extend your store functionality with 8 ultra-performant features like product comparisons, variation swatches, wishlist, and more.', 'feedzy-rss-feeds' ), + 'tpc_desc' => __( 'Design, save, and revisit your templates anytime with your personal vault on Templates Cloud.', 'feedzy-rss-feeds' ), + ), + ) + ); + } + return $labels; } ); diff --git a/includes/admin/feedzy-rss-feeds-admin.php b/includes/admin/feedzy-rss-feeds-admin.php index 6d6ff973f..51b2cb01a 100644 --- a/includes/admin/feedzy-rss-feeds-admin.php +++ b/includes/admin/feedzy-rss-feeds-admin.php @@ -950,7 +950,7 @@ public function feedzy_category_feed() { ' . sprintf( // translators: %1$s and %2$s are placeholders for HTML anchor tags. - __( 'Please be aware that multiple feeds, when mashed together, may sometimes not work as expected as explained %1$s here %2$s.', 'feedzy-rss-feeds' ), + __( 'Please be aware that multiple feeds, when mashed together, may sometimes not work as expected as explained %1$shere%2$s.', 'feedzy-rss-feeds' ), '', '' ) diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index 650315a67..fb0599c5b 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -105,8 +105,12 @@ public function upsell_content( $content, $area, $location ) {
- ' . __( 'This feature is available in the Pro version. Unlock more features, by', 'feedzy-rss-feeds' ) . ' - ' . __( 'upgrading to Feedzy Pro', 'feedzy-rss-feeds' ) . ' + ' . sprintf( + // translators: %1$s and %2$s are HTML tags for the link to the upsell URL. + __( 'This feature is available in the Pro version. Unlock more features, by %1$supgrading to Feedzy Pro%2$s', 'feedzy-rss-feeds' ), + '', + '' + ) . '
'; @@ -434,9 +438,18 @@ public function feedzy_import_feed_options() { 'posts_per_page' => 100, ); $feed_categories = get_posts( $args ); - $post_types = get_post_types( '', 'names' ); - $post_types = array_diff( $post_types, array( 'feedzy_imports', 'feedzy_categories' ) ); - $published_status = array( 'publish', 'draft' ); + $post_types = get_post_types( '', 'object' ); + $post_types = array_diff_key( + $post_types, + array( + 'feedzy_imports' => array(), + 'feedzy_categories' => array(), + ) + ); + $published_status = array( + 'publish' => __( 'Publish', 'feedzy-rss-feeds' ), + 'draft' => __( 'Draft', 'feedzy-rss-feeds' ), + ); $authors = get_users( array( 'number' => 100 ) ); $authors_array = array(); @@ -929,11 +942,27 @@ public function manage_feedzy_import_columns( $column, $post_id ) { $then = new DateTime(); $then = $then->setTimestamp( $last ); $in = $now->diff( $then ); - $msg = sprintf( - // translators: %1$d: number of hours, %2$d: number of minutes. - __( 'Ran %1$d hours %2$d minutes ago', 'feedzy-rss-feeds' ), - $in->format( '%h' ), - $in->format( '%i' ) + + $hours = (int) $in->format( '%h' ); + $minutes = (int) $in->format( '%i' ); + + $hours_text = sprintf( + // translators: %d: number of hours. + _n( '%d hour', '%d hours', $hours, 'feedzy-rss-feeds' ), + $hours + ); + + $minutes_text = sprintf( + // translators: %d: number of minutes. + _n( '%d minute', '%d minutes', $minutes, 'feedzy-rss-feeds' ), + $minutes + ); + + $msg = sprintf( + // translators: %1$s: hours text, %2$s: minutes text. + __( 'Ran %1$s %2$s ago', 'feedzy-rss-feeds' ), + $hours_text, + $minutes_text ); } @@ -2724,7 +2753,12 @@ function ( $term ) { Feedzy_Rss_Feeds_Log::error( sprintf( // translators: %1$d is the number of items without images, %2$d is the total number of items imported. - __( 'Unable to find an image for %1$d out of %2$d items imported', 'feedzy-rss-feeds' ), + _n( + 'Unable to find an image for %1$d out of %2$d item imported', + 'Unable to find an image for %1$d out of %2$d items imported', + $count, + 'feedzy-rss-feeds' + ), $import_image_errors, $count ), @@ -3663,7 +3697,11 @@ public function add_import_actions( $actions, $post ) { } elseif ( 1 === intval( get_post_meta( $post->ID, 'feedzy', true ) ) ) { // show an unclickable action that mentions that it is imported by us so that users are aware. $feedzy_job_id = get_post_meta( $post->ID, 'feedzy_job', true ); - $actions['feedzy'] = sprintf( '(%s %s)', __( 'Imported by Feedzy from', 'feedzy-rss-feeds' ), get_the_title( $feedzy_job_id ) ); + $actions['feedzy'] = sprintf( + // translators: %s is the title of job. + __( 'Imported by Feedzy from %s', 'feedzy-rss-feeds' ), + get_the_title( $feedzy_job_id ) + ); } return $actions; diff --git a/includes/admin/feedzy-rss-feeds-ui-lang.php b/includes/admin/feedzy-rss-feeds-ui-lang.php index f3396e1b6..7860737d6 100644 --- a/includes/admin/feedzy-rss-feeds-ui-lang.php +++ b/includes/admin/feedzy-rss-feeds-ui-lang.php @@ -90,12 +90,8 @@ public static function get_form_defaults() { */ public static function get_form_elements() { $meta = sprintf( - // translators: 1: tag for author, 2: closing tag, 3: tag for date, 4: closing tag, 5: tag for time, 6: closing tag, 7: tag for documentation link, 8: closing tag. - __( 'Should we display additional meta fields out of %1$s author %2$s, %3$s date %4$s and %5$s time %6$s? (comma-separated list, in order of display). View documentation %7$s here %8$s.', 'feedzy-rss-feeds' ), - '', - '', - '', - '', + // translators: 1: tag for author, 2: closing tag, 3: tag for documentation link, 4: closing tag. + __( 'Should we display additional meta fields out of %1$sauthor%2$s, %3$sdate%4$s and %5$stime%6$s? (comma-separated list, in order of display). View documentation %3$shere%4$s.', 'feedzy-rss-feeds' ), '', '', '', @@ -103,14 +99,8 @@ public static function get_form_elements() { ); if ( has_filter( 'feedzy_retrieve_categories' ) ) { $meta = sprintf( - // translators: 1: tag for author, 2: closing tag, 3: tag for date, 4: closing tag, 5: tag for time, 6: closing tag, 7: tag for categories, 8: closing tag, 9: tag for documentation link, 10: closing tag. - __( 'Should we display additional meta fields out of %1$s author%2$s, %3$s date%4$s, %5$s time %6$s and %7$s categories %8$s? (comma-separated list). View documentation %9$s here %10$s.', 'feedzy-rss-feeds' ), - '', - '', - '', - '', - '', - '', + // translators: %1$s is tag, %2$s is closing tag, %3$s is tag for documentation link, %4$s: closing tag. + __( 'Should we display additional meta fields out of %1$sauthor%2$s, %1$sdate%2$s, %1$stime%2$s and %1$scategories%2$s? (comma-separated list). View documentation %3$shere%4$s.', 'feedzy-rss-feeds' ), '', '', '', @@ -120,7 +110,7 @@ public static function get_form_elements() { $multiple = sprintf( // translators: 1: tag for source, 2: closing tag. - __( 'When using multiple sources, should we display additional meta fields? %1$s source %2$s (feed title).', 'feedzy-rss-feeds' ), + __( 'When using multiple sources, should we display additional meta fields?%1$ssource%2$s(feed title).', 'feedzy-rss-feeds' ), '', '' ); @@ -134,7 +124,7 @@ public static function get_form_elements() { __( 'The feed(s) URL (comma-separated list).', 'feedzy-rss-feeds' ) . ' ' . sprintf( // translators: 1: tag opening, 2: tag closing. - __( 'Click %1$s here %2$s to check if feed is valid.', 'feedzy-rss-feeds' ), + __( 'Click %1$shere%2$s to check if feed is valid.', 'feedzy-rss-feeds' ), '', '' ) @@ -484,12 +474,12 @@ public static function get_form_elements() { ), 'section_pro' => array( 'title' => __( 'PRO Options', 'feedzy-rss-feeds' ), - 'description' => __( 'Get access to more options and customizations with full version of Feedzy RSS Feeds . Use existing templates or extend them and make them your own.', 'feedzy-rss-feeds' ) . '
' . __( 'See more features of Feedzy RSS Feeds PRO', 'feedzy-rss-feeds' ) . '', + 'description' => __( 'Get access to more options and customizations with full version of Feedzy RSS Feeds. Use existing templates or extend them and make them your own.', 'feedzy-rss-feeds' ) . '
' . __( 'See more features of Feedzy RSS Feeds PRO', 'feedzy-rss-feeds' ) . '', 'elements' => array( 'price' => array( 'label' => sprintf( // translators: 1:
tag, 2: tag opening, 3: tag closing. - __( 'Should we display the price from the feed if it is available? %1$s You can read about how to extract price from a custom tag %2$s here %3$s', 'feedzy-rss-feeds' ), + __( 'Should we display the price from the feed if it is available?%1$sYou can read about how to extract price from a custom tag %2$shere%3$s', 'feedzy-rss-feeds' ), '
', '', '' @@ -511,7 +501,7 @@ public static function get_form_elements() { 'referral_url' => array( 'label' => sprintf( // translators: 1: tag opening, 2: tag closing. - __( 'Referral URL parameters as per %1$s this document here %2$s', 'feedzy-rss-feeds' ), + __( 'Referral URL parameters as per %1$sthis document here%2$s', 'feedzy-rss-feeds' ), '', '' ), @@ -531,7 +521,7 @@ public static function get_form_elements() { 'mapping' => array( 'label' => sprintf( // translators: 1: tag opening, 2: tag closing. - __( 'Provide mapping for custom feed elements as per %1$s this document here %2$s. This will only work for single feeds, not comma-separated feeds.', 'feedzy-rss-feeds' ), + __( 'Provide mapping for custom feed elements as per %1$sthis document here%2$s. This will only work for single feeds, not comma-separated feeds.', 'feedzy-rss-feeds' ), '', '' ), diff --git a/includes/admin/feedzy-rss-feeds-ui.php b/includes/admin/feedzy-rss-feeds-ui.php index aa02b874e..e1ae6d612 100644 --- a/includes/admin/feedzy-rss-feeds-ui.php +++ b/includes/admin/feedzy-rss-feeds-ui.php @@ -238,7 +238,7 @@ public function feedzy_import_post_title_section() { $content = __( 'You are using Feedzy Lite.', 'feedzy-rss-feeds' ) . ' '; // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. - $content .= wp_sprintf( __( 'Unlock more powerful features, by %1$s upgrading to Feedzy Pro %2$s and get 50%% off.', 'feedzy-rss-feeds' ), '', '' ); + $content .= wp_sprintf( __( 'Unlock more powerful features, by %1$supgrading to Feedzy Pro%2$s and get 50%% off.', 'feedzy-rss-feeds' ), '', '' ); echo wp_kses_post( $content ); ?> diff --git a/includes/elementor/widgets/register-widget.php b/includes/elementor/widgets/register-widget.php index 745e7cc45..3abfd7075 100644 --- a/includes/elementor/widgets/register-widget.php +++ b/includes/elementor/widgets/register-widget.php @@ -106,7 +106,7 @@ protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDecl 'type' => Controls_Manager::TEXTAREA, 'description' => wp_sprintf( // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. - __( 'You can add multiple sources at once, by separating them with commas. %1$s Click here %2$s to check if the feed is valid. Invalid feeds may not import anything.', 'feedzy-rss-feeds' ), + __( 'You can add multiple sources at once, by separating them with commas. %1$sClick here%2$s to check if the feed is valid. Invalid feeds may not import anything.', 'feedzy-rss-feeds' ), '', '' ), @@ -505,7 +505,7 @@ protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDecl 'description' => wp_sprintf( // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. __( - 'Learn more about this feature in %1$s Feedzy docs %2$s .', + 'Learn more about this feature in %1$sFeedzy docs%2$s.', 'feedzy-rss-feeds' ), '', @@ -572,7 +572,7 @@ protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDecl ! feedzy_is_pro() ? wp_sprintf( // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. - __( 'Unlock this feature and more advanced options with %1$s Feedzy Pro %1$s.', 'feedzy-rss-feeds' ), + __( 'Unlock this feature and more advanced options with %1$sFeedzy Pro%2$s.', 'feedzy-rss-feeds' ), '', '' ) diff --git a/includes/layouts/feedzy-improve.php b/includes/layouts/feedzy-improve.php index 97dc10bf1..7bb3e6073 100644 --- a/includes/layouts/feedzy-improve.php +++ b/includes/layouts/feedzy-improve.php @@ -8,9 +8,10 @@

diff --git a/includes/layouts/feedzy-pro.php b/includes/layouts/feedzy-pro.php index 296b95d45..072dfa9f1 100644 --- a/includes/layouts/feedzy-pro.php +++ b/includes/layouts/feedzy-pro.php @@ -14,10 +14,10 @@

-
  • +
  • -
  • +
  • @@ -27,10 +27,10 @@

    -
  • +
  • -
  • +
  • @@ -41,10 +41,10 @@

    -
  • +
  • -
  • +
  • @@ -57,10 +57,10 @@

    -
  • +
  • -
  • +
  • @@ -74,10 +74,10 @@

    -
  • +
  • -
  • +
  • @@ -89,13 +89,13 @@

    - +

    -
  • +
  • -
  • +
  • @@ -109,10 +109,10 @@

    -
  • +
  • -
  • +
  • @@ -126,15 +126,14 @@

    -
  • +
  • -
  • +
  • @@ -156,10 +155,10 @@ ?>

    -
  • +
  • -
  • +
  • @@ -173,10 +172,10 @@

    -
  • +
  • -
  • +
  • diff --git a/includes/layouts/feedzy-schedules.php b/includes/layouts/feedzy-schedules.php index 3ef5a699e..a3662141f 100644 --- a/includes/layouts/feedzy-schedules.php +++ b/includes/layouts/feedzy-schedules.php @@ -40,7 +40,7 @@ class="form-control" type="text" class="form-control" id="fz-schedule-display" - placeholder="Once Hourly" + placeholder= /> @@ -53,7 +53,7 @@ class="form-control" type="text" class="form-control" id="fz-schedule-name" - placeholder="hourly" + placeholder= /> @@ -83,7 +83,7 @@ class="fz-schedules-table" $schedule_count = count( $custom_schedules ); // translators: %s is the number of custom schedules. - echo esc_html( sprintf( __( '%s items', 'feedzy-rss-feeds' ), $schedule_count ) ); + echo esc_html( sprintf( _n( '%d item', '%d items', $schedule_count, 'feedzy-rss-feeds' ) ) ); ?> diff --git a/includes/layouts/setup-wizard.php b/includes/layouts/setup-wizard.php index 8d61f8c53..2e9efc88b 100644 --- a/includes/layouts/setup-wizard.php +++ b/includes/layouts/setup-wizard.php @@ -22,7 +22,10 @@ $wizard_data = get_option( 'feedzy_wizard_data', array() ); $feed_source = ! empty( $wizard_data['feed'] ) ? $wizard_data['feed'] : ''; } -$published_status = array( 'publish', 'draft' ); +$published_status = array( + 'publish' => __( 'Publish', 'feedzy-rss-feeds' ), + 'draft' => __( 'Draft', 'feedzy-rss-feeds' ), +); add_thickbox(); ?> @@ -86,7 +89,7 @@