Skip to content

Commit

Permalink
chore: review
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Nov 20, 2024
1 parent 6492821 commit 0557610
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 39 deletions.
22 changes: 14 additions & 8 deletions backend/templates/admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,14 @@ class="nmsf-label <?php echo ! $is_available ? 'ppom-is-locked-section' : ''; ?
<?php if ( ! $is_available ): ?>
<div class="ppom-notice-upsell"><p>
<?php echo sprintf(
// translators: %1$s: the name of plugin feature, %2$s: opening anchor tag, %3$s: closing anchor tag.
__( '%1$s customization is not available on your current plan. %2$sUpgrade to the Pro%2$s plan to unlock the ability to fully enable and customize this functionality.', 'woocommerce-product-addon' ),
// translators: %1$s: the name of plugin feature, %2$s: the upgrade link.
__( '%1$s customization is not available on your current plan. %2$s plan to unlock the ability to fully enable and customize this functionality.', 'woocommerce-product-addon' ),
esc_html( $title ),
sprintf( '<a href="%s" target="_blank">', esc_url( tsdk_translate_link( tsdk_utmify( PPOM_UPGRADE_URL, $id ) ) ) ),
'</a>'
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( tsdk_translate_link( tsdk_utmify( PPOM_UPGRADE_URL, $id ) ) ),
__( 'Upgrade to the Pro', 'woocommerce-product-addon' )
)
); ?>
</p>
</div>
Expand Down Expand Up @@ -149,11 +152,14 @@ class="<?php echo $condition_class; ?>"
<?php if ( $is_available && !$is_input_available ): ?>
<div class="ppom-notice-upsell"><p>
<?php echo sprintf(
// translators: %1$s: the name of plugin feature, %2$s: opening anchor tag, %3$s: closing anchor tag.
__( '%1$s customization is not available on your current plan. %2$sUpgrade to the Pro%3$s plan to unlock the ability to fully enable and customize this functionality.', 'woocommerce-product-addon' ),
// translators: %1$s: the name of plugin feature, %2$s: opening anchor tag.
__( '%1$s customization is not available on your current plan. %2$s plan to unlock the ability to fully enable and customize this functionality.', 'woocommerce-product-addon' ),
esc_html( $title ),
sprintf( '<a href="%s" target="_blank">', esc_url( tsdk_translate_link( tsdk_utmify( PPOM_UPGRADE_URL, $id ) ) ) ),
'</a>'
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( tsdk_translate_link( tsdk_utmify( PPOM_UPGRADE_URL, $id ) ) ),
__( 'Upgrade to the Pro', 'woocommerce-product-addon' )
)
); ?>
</p>
</div>
Expand Down
11 changes: 7 additions & 4 deletions classes/admin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,13 @@ function get_products() {
$current_saved_value = $this->get_db_field( $ppom_id );
$pro_multiple_fields = ! ppom_pro_is_installed() || 'valid' !== $license_status
? '</br><i style="font-size: 90%">' . sprintf(
// translators: %1$s: the opening tag for upsell link, %2$s: the closing tag for upsell link.
__( 'Your current plan supports adding one group of fields per product. To add multiple groups to the same product, please %1$supgrade%2$s your plan!', 'woocommerce-product-addon' ),
'<a target="_blank" href="' . tsdk_utmify( tsdk_translate_link( PPOM_UPGRADE_URL ), 'multiple-fields' ) . '">',
'</a>'
// translators: %1$s: the link to the store with label 'upgrade'.
__( 'Your current plan supports adding one group of fields per product. To add multiple groups to the same product, please %1$ your plan!', 'woocommerce-product-addon' ),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( tsdk_utmify( tsdk_translate_link( PPOM_UPGRADE_URL ), 'multiple-fields' ) ),
__( 'Upgrade to the Pro', 'woocommerce-product-addon' )
)
) . '</i>'
: '';
$select_products_id_component = ( new \PPOM\Attach\SelectComponent() )
Expand Down
12 changes: 8 additions & 4 deletions inc/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,14 @@ function ppom_meta_list( $post ) {
$html .= '<hr>';
$html .= '<div class="ppom-settings-container">';
$html .= '<label class="ppom-settings-container-item ppom-disabled-text"><input disabled type="checkbox">' . __( 'Enable Enquiry Form', 'woocommerce-product-addon' ) . '<span class="woocommerce-help-tip" data-tip="' . __( 'Enhances your product pages by adding a customizable enquiry button. It allows customers to send inquiries directly to the admin about products with PPOM Fields via email.', 'woocommerce-product-addon' ) . '"></span><i>' . sprintf(
// translators: %1$s the opening link HTML tag, %2$s the close link HTML tag.
__( 'Available in the %1$sPremium%2$s version.', 'woocommerce-product-addon' ),
'<a target="_blank" href="' . tsdk_utmify( tsdk_translate_link( PPOM_UPGRADE_URL ), 'enable-enquiry', 'metabox' ) . '">',
'</a>'
// translators: %1$s the link to Store with label: 'Premium'.
__( 'Available in the %1$s version.', 'woocommerce-product-addon' ),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( tsdk_utmify( tsdk_translate_link( PPOM_UPGRADE_URL ), 'enable-enquiry', 'metabox' ) ),
__( 'Premium', 'woocommerce-product-addon' )
)

) . '</i></label>';
$html .= '</div>';

Expand Down
16 changes: 6 additions & 10 deletions inc/arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,19 @@ function ppom_array_settings() {
array(
'title' => 'Settings Panel Migration',
'type' => 'title',
'desc' => wp_sprintf(
// translators: %1$s: the opening HTML link tags, %2$s: the closing HTML link tags.
__( 'Please migrate settings to new settings panel framework. %1$sStart Migration%2$s', 'woocommerce-product-addon' ),
'<a class="page-title-action" href="' . esc_url( $ppom_migrate_url ) . '">',
'</a>'
'desc' => esc_html(
__( 'Please migrate settings to new settings panel framework.', 'woocommerce-product-addon' ) . ' ' .
'<a class="page-title-action" href="' . esc_url( $ppom_migrate_url ) . '">' . __( 'Start Migration', 'woocommerce-product-addon' ) . '</a>'
),
'id' => 'ppom_settings_migration',
),

array(
'title' => 'PPOM Labels',
'type' => 'title',
'desc' => wp_sprintf(
// translators: %1$s: the opening HTML link tags, %2$s: the closing HTML link tags.
__( 'Following settings help you the control and customize plugin as per your need. %1$sPPOM Fields Manager%2$s', 'woocommerce-product-addon' ),
'<a href="' . esc_url( $ppom_fields ) . '">',
'</a>'
'desc' => esc_html(
__( 'Following settings help you the control and customize plugin as per your need.', 'woocommerce-product-addon' ) . ' ' .
'<a href="' . esc_url( $ppom_fields ) . '">' . __( 'PPOM Fields Manager', 'woocommerce-product-addon' ) . '</a>'
),
'id' => 'ppom_labels_settings',
),
Expand Down
6 changes: 3 additions & 3 deletions inc/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function ppom_delete_file() {
$ppom_nonce = sanitize_key( $_REQUEST['ppom_nonce'] );
$file_nonce_action = 'ppom_deleting_file_action';
if ( ! wp_verify_nonce( $ppom_nonce, $file_nonce_action ) ) {
// translators: $s: the name of file
// translators: %s: the name of file
printf( __( 'Verification failed for file: %s', 'woocommerce-product-addon' ), $file_name );
die( 0 );
}
Expand All @@ -433,11 +433,11 @@ function ppom_delete_file() {
if ( ! file_exists( $file_path ) ) {
_e( 'File removed', 'woocommerce-product-addon' );
} else {
// translators: $s: the name of file
// translators: %s: the name of file
printf( __( 'Error while deleting file %s', 'woocommerce-product-addon' ), $file_path );
}
} else {
// translators: $s: the name of file
// translators: %s: the name of file
printf( __( 'The file %s does not exists.', 'woocommerce-product-addon' ), $file_path );
}

Expand Down
2 changes: 1 addition & 1 deletion inc/prices.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ function ppom_generate_field_price( $field_price, $field_meta, $apply, $option =
$option_id = isset( $option['option_id'] ) ? $option['option_id'] : '';

if ( $field_type == 'file' ) {
// translators: $d: the number of files options.
// translators: %d: the number of files options.
$option_label = sprintf( __( '%d Files', 'woocommerce-product-addon' ), count( $option ) );
}

Expand Down
11 changes: 7 additions & 4 deletions templates/admin/ppom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,13 @@ class="dashicons dashicons-editor-help"></i></span>
<p>
<?php
echo sprintf(
// translators: %1$s the opening HTML link tag, %2$s the closing HTML link tag.
__( 'Custom CSS and JS customization is not available on your current plan. %1$sUpgrade to the Pro%2$s plan to unlock the ability to fully customize your fields\' appearance and functionality.', 'woocommerce-product-addon' ),
'<a href="' . esc_url( tsdk_translate_link( tsdk_utmify( PPOM_UPGRADE_URL, 'customstyle' ) ) ) . '" target="_blank">',
'</a>'
// translators: %1$s the upgrade link with label: 'Upgrade To Pro'.
__( 'Custom CSS and JS customization is not available on your current plan. %1$s plan to unlock the ability to fully customize your fields\' appearance and functionality.', 'woocommerce-product-addon' ),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( tsdk_translate_link( tsdk_utmify( PPOM_UPGRADE_URL, 'customstyle' ) ) ),
__( 'Upgrade to the Pro', 'woocommerce-product-addon' )
)
);
?>
</p>
Expand Down
10 changes: 5 additions & 5 deletions templates/render-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ function( $collapse_field ) {
<span class="ppom-option-notice">
<?php
printf(
// translators: %1$s the name of the field, %2$s the opening tag for HTML strong, %3$s the closing tag for HTML strong.
__( 'The %1$s field cannot be used because the Conditional Field Repeater mode is activated, although Legacy Input Rendering is enabled. %2$sConditional Field Repeater%3$s cannot work if the %2$sLegacy Input Rendering%3$s is enabled.' ),
sprintf('<strong>%s</strong>', esc_html( $title ) ),
'<strong>',
'</strong>'
// translators: %1$s: the name of the field, %2$s: label 'Conditional Field Repeater' with bold, %3$s: label 'Legacy Input Rendering' with bold.
__( 'The %1$s field cannot be used because the Conditional Field Repeater mode is activated, although Legacy Input Rendering is enabled. %2$s cannot work if the %3$s is enabled.', 'woocommerce-product-addon' ),
'<strong>' . esc_html( $title ) . '</strong>',
'<strong>' . __( 'Conditional Field Repeater', 'woocommerce-product-addon' ) . '</strong>',
'<strong>' . __( 'Legacy Input Rendering', 'woocommerce-product-addon' ) . '</strong>',
);
?>
</span>
Expand Down

0 comments on commit 0557610

Please sign in to comment.