From 5b647ae5e93e7c84adc6f54779c89ab8bcfa4b8a Mon Sep 17 00:00:00 2001 From: ashubawork Date: Thu, 13 Jul 2023 11:36:29 +0300 Subject: [PATCH] - add translators --- includes/admin/core/class-admin-upgrade.php | 19 ++++++++++-- .../core/list-tables/emails-list-table.php | 9 +++--- .../core/packages/2.0-beta1/functions.php | 15 +++++---- .../core/packages/2.1.3-beta3/functions.php | 7 +++-- .../admin/core/packages/2.3.0/functions.php | 7 +++-- includes/admin/templates/dashboard/cache.php | 9 ++++-- includes/admin/templates/dashboard/purge.php | 12 ++++--- includes/admin/templates/gdpr.php | 12 +++++-- .../admin/templates/modal/forms/fonticons.php | 14 ++++++--- includes/class-dependencies.php | 26 ++++++++++------ includes/class-extensions.php | 3 +- includes/core/class-date-time.php | 19 +++++++++--- includes/core/class-fields.php | 7 +++-- includes/core/class-member-directory.php | 3 ++ includes/core/class-password.php | 2 ++ includes/core/class-uploader.php | 2 ++ includes/core/um-actions-form.php | 31 +++++++++++++++++-- includes/core/um-actions-profile.php | 8 ++++- includes/core/um-filters-fields.php | 2 ++ includes/um-short-functions.php | 3 +- templates/members.php | 5 +-- templates/profile/comments-single.php | 7 ++++- templates/profile/posts-single.php | 6 +++- 23 files changed, 168 insertions(+), 60 deletions(-) diff --git a/includes/admin/core/class-admin-upgrade.php b/includes/admin/core/class-admin-upgrade.php index ae30e70b..c0d1423c 100644 --- a/includes/admin/core/class-admin-upgrade.php +++ b/includes/admin/core/class-admin-upgrade.php @@ -134,7 +134,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) { - + get_allowed_html( 'admin_notice' ) ); + ?>
-

-

%s version. Your latest DB version is %s. We recommend creating a backup of your site before running the update process. Do not exit the page before the update process has complete.', 'ultimate-member' ), ultimatemember_version, $um_last_version_upgrade ) ?>

+

+ get_allowed_html( 'admin_notice' ) ); + ?> +

+

+ %1$s version. Your latest DB version is %2$s. We recommend creating a backup of your site before running the update process. Do not exit the page before the update process has complete.', 'ultimate-member' ), ultimatemember_version, $um_last_version_upgrade ), JB()->get_allowed_html( 'admin_notice' ) ); + ?> +

"Run" button, the update process will start. All information will be displayed in the "Upgrade Log" field.', 'ultimate-member' ); ?>

diff --git a/includes/admin/core/list-tables/emails-list-table.php b/includes/admin/core/list-tables/emails-list-table.php index a23242ff..ebef371c 100644 --- a/includes/admin/core/list-tables/emails-list-table.php +++ b/includes/admin/core/list-tables/emails-list-table.php @@ -320,9 +320,10 @@ $ListTable->items = array_slice( $emails, ( $paged - 1 ) * $per_page, $per_page $ListTable->wpc_set_pagination_args( array( 'total_items' => count( $emails ), 'per_page' => $per_page ) ); ?>

- here', 'ultimate-member' ), - 'https://docs.ultimatemember.com/article/1335-email-templates' - ); ?> + here', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/1335-email-templates' ), JB()->get_allowed_html( 'admin_notice' ) ); + ?>

@@ -330,4 +331,4 @@ $ListTable->wpc_set_pagination_args( array( 'total_items' => count( $emails ), ' display(); ?> -
\ No newline at end of file + diff --git a/includes/admin/core/packages/2.0-beta1/functions.php b/includes/admin/core/packages/2.0-beta1/functions.php index 2c998794..830b6fdc 100644 --- a/includes/admin/core/packages/2.0-beta1/functions.php +++ b/includes/admin/core/packages/2.0-beta1/functions.php @@ -84,9 +84,10 @@ function um_upgrade_update_users_per_page20beta1() { } $from = ( absint( $_POST['page'] ) * $users_per_page ) - $users_per_page + 1; - $to = absint( $_POST['page'] ) * $users_per_page; + $to = absint( $_POST['page'] ) * $users_per_page; - wp_send_json_success( array( 'message' => sprintf( __( 'Users from %s to %s was upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); + // translators: %1$s is a from; %2$s is a to. + wp_send_json_success( array( 'message' => sprintf( __( 'Users from %1$s to %2$s was upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); } else { wp_send_json_error(); } @@ -213,9 +214,10 @@ function um_upgrade_update_forum_per_page20beta1() { } $from = ( absint( $_POST['page'] ) * $posts_per_page ) - $posts_per_page + 1; - $to = absint( $_POST['page'] ) * $posts_per_page; + $to = absint( $_POST['page'] ) * $posts_per_page; - wp_send_json_success( array( 'message' => sprintf( __( 'Forums from %s to %s was upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); + // translators: %1$s is a from; %2$s is a to. + wp_send_json_success( array( 'message' => sprintf( __( 'Forums from %1$s to %2$s was upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); } else { wp_send_json_error(); } @@ -300,9 +302,10 @@ function um_upgrade_update_products_per_page20beta1() { } $from = ( absint( $_POST['page'] ) * $posts_per_page ) - $posts_per_page + 1; - $to = absint( $_POST['page'] ) * $posts_per_page; + $to = absint( $_POST['page'] ) * $posts_per_page; - wp_send_json_success( array( 'message' => sprintf( __( 'Woocommerce Products from %s to %s was upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); + // translators: %1$s is a from; %2$s is a to. + wp_send_json_success( array( 'message' => sprintf( __( 'Woocommerce Products from %1$s to %2$s was upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); } else { wp_send_json_error(); } diff --git a/includes/admin/core/packages/2.1.3-beta3/functions.php b/includes/admin/core/packages/2.1.3-beta3/functions.php index 66cffd7f..9609ce10 100644 --- a/includes/admin/core/packages/2.1.3-beta3/functions.php +++ b/includes/admin/core/packages/2.1.3-beta3/functions.php @@ -46,7 +46,7 @@ function um_upgrade_metadata_per_user213beta3() { um.meta_value as meta_value FROM {$wpdb->users} u LEFT JOIN {$wpdb->usermeta} um ON ( um.user_id = u.ID AND um.meta_key IN( 'account_status','hide_in_members','synced_gravatar_hashed_id','synced_profile_photo','profile_photo','cover_photo','_um_verified' ) ) - WHERE u.ID >= %d AND + WHERE u.ID >= %d AND u.ID <= %d", $min_max['MinID'], $min_max['MaxID'] @@ -113,9 +113,10 @@ function um_upgrade_metadata_per_user213beta3() { } $from = ( absint( $_POST['page'] ) * $per_page ) - $per_page + 1; - $to = absint( $_POST['page'] ) * $per_page; + $to = absint( $_POST['page'] ) * $per_page; - wp_send_json_success( array( 'message' => sprintf( __( 'Metadata from %s to %s users were upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); + // translators: %1$s is a from; %2$s is a to. + wp_send_json_success( array( 'message' => sprintf( __( 'Metadata from %1$s to %2$s users were upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); } diff --git a/includes/admin/core/packages/2.3.0/functions.php b/includes/admin/core/packages/2.3.0/functions.php index 51f0b60d..308c1a93 100644 --- a/includes/admin/core/packages/2.3.0/functions.php +++ b/includes/admin/core/packages/2.3.0/functions.php @@ -103,7 +103,7 @@ function um_upgrade_usermeta_part230() { $wpdb->prepare( "SELECT user_id, meta_key, - meta_value + meta_value FROM {$wpdb->usermeta} WHERE meta_key IN( '" . implode( "','", $fields_for_upgrade ) . "' ) LIMIT %d, %d", @@ -127,9 +127,10 @@ function um_upgrade_usermeta_part230() { } $from = ( absint( $_POST['page'] ) * $per_page ) - $per_page + 1; - $to = absint( $_POST['page'] ) * $per_page; + $to = absint( $_POST['page'] ) * $per_page; - wp_send_json_success( array( 'message' => sprintf( __( 'Metadata from %s to %s row were upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); + // translators: %1$s is a from; %2$s is a to. + wp_send_json_success( array( 'message' => sprintf( __( 'Metadata from %1$s to %2$s row were upgraded successfully...', 'ultimate-member' ), $from, $to ) ) ); } diff --git a/includes/admin/templates/dashboard/cache.php b/includes/admin/templates/dashboard/cache.php index 364417ac..a2241443 100644 --- a/includes/admin/templates/dashboard/cache.php +++ b/includes/admin/templates/dashboard/cache.php @@ -5,8 +5,8 @@ global $wpdb; $count = $wpdb->get_var( - "SELECT COUNT( option_id ) - FROM {$wpdb->options} + "SELECT COUNT( option_id ) + FROM {$wpdb->options} WHERE option_name LIKE 'um_cache_userdata_%'" ); ?> @@ -15,7 +15,10 @@ $count = $wpdb->get_var(

- + diff --git a/includes/admin/templates/dashboard/purge.php b/includes/admin/templates/dashboard/purge.php index 6e54fbae..c3fa8c62 100644 --- a/includes/admin/templates/dashboard/purge.php +++ b/includes/admin/templates/dashboard/purge.php @@ -1,10 +1,14 @@ -dir_size( 'temp' ) > 0.1 ) { ?>

- %s MB by purging your temp upload directory.', 'ultimate-member' ), $this->dir_size( 'temp' ) ); ?> + %s MB by purging your temp upload directory.', 'ultimate-member' ), $this->dir_size( 'temp' ) ), JB()->get_allowed_html( 'admin_notice' ) ); + ?>

@@ -19,4 +23,4 @@ if ( $this->dir_size( 'temp' ) > 0.1 ) { ?> clean. There is nothing to purge.', 'ultimate-member' ); ?>

- \ No newline at end of file + diff --git a/includes/admin/templates/gdpr.php b/includes/admin/templates/gdpr.php index da6334ed..ed88ebf0 100644 --- a/includes/admin/templates/gdpr.php +++ b/includes/admin/templates/gdpr.php @@ -7,7 +7,10 @@

- + get_allowed_html( 'admin_notice' ) ); + ?>

@@ -33,8 +36,11 @@

- + get_allowed_html( 'admin_notice' ) ); + ?>

-

\ No newline at end of file +

diff --git a/includes/admin/templates/modal/forms/fonticons.php b/includes/admin/templates/modal/forms/fonticons.php index 3e426f5e..71a67f88 100644 --- a/includes/admin/templates/modal/forms/fonticons.php +++ b/includes/admin/templates/modal/forms/fonticons.php @@ -1,10 +1,16 @@ - - +
-
\ No newline at end of file + diff --git a/includes/class-dependencies.php b/includes/class-dependencies.php index e29946c6..1bc977e0 100644 --- a/includes/class-dependencies.php +++ b/includes/class-dependencies.php @@ -193,13 +193,17 @@ if ( ! class_exists( 'um\Dependencies' ) ) { $message = ''; if ( version_compare( ultimatemember_version, $um_required_ver, '<' ) ) { - $message = sprintf( __( 'This version of "%s" requires the core %s plugin to be %s or higher.', 'ultimate-member' ), $ext_title, ultimatemember_plugin_name, $um_required_ver ) . - '
' . - sprintf( __( 'Please update %s to the latest version.', 'ultimate-member' ), ultimatemember_plugin_name ); - } elseif ( empty( $this->ext_required_version[$ext_key] ) || version_compare( $this->ext_required_version[$ext_key], $ext_ver, '>' ) ) { - $message = sprintf( __( 'Sorry, but this version of %s does not work with extension "%s" %s version.', 'ultimate-member' ), ultimatemember_plugin_name, $ext_title, $ext_ver ) . - '
' . - sprintf( __( 'Please update extension "%s" to the latest version.', 'ultimate-member' ), $ext_title ); + // translators: %1$s is a extension name; %2$s is a plugin name; %3$s is a required version. + $message = sprintf( __( 'This version of "%1$s" requires the core %2$s plugin to be %3$s or higher.', 'ultimate-member' ), $ext_title, ultimatemember_plugin_name, $um_required_ver ) . + '
' . + // translators: %s: plugin name. + sprintf( __( 'Please update %s to the latest version.', 'ultimate-member' ), ultimatemember_plugin_name ); + } elseif ( empty( $this->ext_required_version[ $ext_key ] ) || version_compare( $this->ext_required_version[ $ext_key ], $ext_ver, '>' ) ) { + // translators: %1$s is a plugin name; %2$s is a extension name; %3$s is a extension version. + $message = sprintf( __( 'Sorry, but this version of %1$s does not work with extension "%2$s" %3$s version.', 'ultimate-member' ), ultimatemember_plugin_name, $ext_title, $ext_ver ) . + '
' . + // translators: %s: extension name. + sprintf( __( 'Please update extension "%s" to the latest version.', 'ultimate-member' ), $ext_title ); } return $message; @@ -208,9 +212,11 @@ if ( ! class_exists( 'um\Dependencies' ) ) { if ( ! self::$active_plugins ) self::init(); if ( ! in_array( "um-{$ext_key}/um-{$ext_key}.php", self::$active_plugins ) && ! array_key_exists( "um-{$ext_key}/um-{$ext_key}.php", self::$active_plugins ) ) { - $message = sprintf( __( 'Please check "%s" %s extension\'s folder name.', 'ultimate-member' ), $ext_title, $ext_ver ) . - '
' . - sprintf( __( 'Correct folder name is "%s"', 'ultimate-member' ), "um-{$ext_key}" ); + // translators: %1$s is a extension name; %2$s is a extension version. + $message = sprintf( __( 'Please check "%1$s" %2$s extension\'s folder name.', 'ultimate-member' ), $ext_title, $ext_ver ) . + '
' . + // translators: %s: extension name. + sprintf( __( 'Correct folder name is "%s"', 'ultimate-member' ), "um-{$ext_key}" ); return $message; } diff --git a/includes/class-extensions.php b/includes/class-extensions.php index 1bd39193..b1d53a36 100644 --- a/includes/class-extensions.php +++ b/includes/class-extensions.php @@ -98,6 +98,7 @@ if ( ! class_exists( 'um\Extensions' ) ) { $settings['licenses']['fields'][] = array( 'id' => "um_{$slug}_license_key", + // translators: %s: extension name. 'label' => sprintf( __( '%s License Key', 'ultimate-member' ), $extension['title'] ), 'item_name' => $extension['item_name'], 'author' => 'Ultimate Member', @@ -227,4 +228,4 @@ if ( ! class_exists( 'um\Extensions' ) ) { } -} \ No newline at end of file +} diff --git a/includes/core/class-date-time.php b/includes/core/class-date-time.php index 7af01cc0..18921338 100644 --- a/includes/core/class-date-time.php +++ b/includes/core/class-date-time.php @@ -60,6 +60,7 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $mins = 1; } + // translators: %s: min time. $since = sprintf( _n( '%s min', '%s mins', $mins, 'ultimate-member' ), $mins ); } elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) { @@ -69,6 +70,7 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $hours = 1; } + // translators: %s: hours. $since = sprintf( _n( '%s hr', '%s hrs', $hours, 'ultimate-member' ), $hours ); } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) { @@ -79,22 +81,27 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { } if ( $days == 1 ) { + // translators: %s: time. $since = sprintf( __( 'Yesterday at %s', 'ultimate-member' ), date_i18n( get_option( 'time_format' ), $from ) ); } else { - $since = sprintf( __( '%s at %s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( get_option( 'time_format' ), $from ) ); + // translators: %1$s is a date; %2$s is a time. + $since = sprintf( __( '%1$s at %2$s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( get_option( 'time_format' ), $from ) ); } } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) { - $since = sprintf( __( '%s at %s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( get_option( 'time_format' ), $from ) ); + // translators: %1$s is a date; %2$s is a time. + $since = sprintf( __( '%1$s at %2$s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( get_option( 'time_format' ), $from ) ); } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) { - $since = sprintf( __( '%s at %s','ultimate-member'), date_i18n( 'F d', $from ), date_i18n( get_option( 'time_format' ), $from ) ); + // translators: %1$s is a date; %2$s is a time. + $since = sprintf( __( '%1$s at %2$s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( get_option( 'time_format' ), $from ) ); } elseif ( $diff >= YEAR_IN_SECONDS ) { - $since = sprintf( __( '%s at %s', 'ultimate-member' ), date_i18n( get_option( 'date_format' ), $from ), date_i18n( get_option( 'time_format' ), $from ) ); + // translators: %1$s is a date; %2$s is a time. + $since = sprintf( __( '%1$s at %2$s', 'ultimate-member' ), date_i18n( get_option( 'date_format' ), $from ), date_i18n( get_option( 'time_format' ), $from ) ); } @@ -143,9 +150,11 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $age--; } if ( $age == 1 ) { + // translators: %s: age. return sprintf( __( '%s year old', 'ultimate-member' ), $age ); } if ( $age > 1 ) { + // translators: %s: age. return sprintf( __( '%s years old', 'ultimate-member' ), $age ); } if ( $age == 0 ) { @@ -189,4 +198,4 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { } } -} \ No newline at end of file +} diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 4a5be146..a9510b69 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2530,7 +2530,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= $this->field_label( $label_confirm_pass, $key, $data ); } elseif ( isset( $data['label'] ) ) { $data['label'] = __( $data['label'], 'ultimate-member' ); - /* translators: 1: label, 2: key, 3: data. */ + // translators: %s: label. $output .= $this->field_label( sprintf( __( 'Confirm %s', 'ultimate-member' ), $data['label'] ), $key, $data ); } @@ -2548,10 +2548,10 @@ if ( ! class_exists( 'um\core\Fields' ) ) { if ( ! empty( $data['label_confirm_pass'] ) ) { $placeholder = __( $data['label_confirm_pass'], 'ultimate-member' ); } elseif ( ! empty( $placeholder ) && ! isset( $data['label'] ) ) { - /* translators: 1: placeholder. */ + // translators: %s: placeholder. $placeholder = sprintf( __( 'Confirm %s', 'ultimate-member' ), $placeholder ); } elseif ( isset( $data['label'] ) ) { - /* translators: 1: label. */ + // translators: %s: label. $placeholder = sprintf( __( 'Confirm %s', 'ultimate-member' ), $data['label'] ); } @@ -4489,6 +4489,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } else { $edit_url = um_edit_profile_url(); } + // translators: %s: edit user link. $output .= '

' . $emo . '' . sprintf( __( 'Your profile is looking a little empty. Why not add some information!', 'ultimate-member' ), esc_url( $edit_url ) ) . '

'; } else { $output .= '

' . $emo . '' . __( 'This user has not added any information to their profile yet.', 'ultimate-member' ) . '

'; diff --git a/includes/core/class-member-directory.php b/includes/core/class-member-directory.php index de3c1335..032cc862 100644 --- a/includes/core/class-member-directory.php +++ b/includes/core/class-member-directory.php @@ -343,6 +343,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) { } if ( isset( $data['type'] ) && in_array( $data['type'], $this->sorting_supported_fields ) ) { + // translators: %s: title. if ( isset( $data['title'] ) && array_search( sprintf( __( '%s DESC', 'ultimate-member' ), $data['title'] ), $this->sort_fields ) !== false ) { $data['title'] = $data['title'] . ' (' . $key . ')'; } @@ -352,7 +353,9 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) { continue; } + // translators: %s: title. $this->sort_fields[ $key . '_desc' ] = sprintf( __( '%s DESC', 'ultimate-member' ), $title ); + // translators: %s: title. $this->sort_fields[ $key . '_asc' ] = sprintf( __( '%s ASC', 'ultimate-member' ), $title ); } } diff --git a/includes/core/class-password.php b/includes/core/class-password.php index 1b3e5ee4..8c2f2167 100644 --- a/includes/core/class-password.php +++ b/includes/core/class-password.php @@ -517,10 +517,12 @@ if ( ! class_exists( 'um\core\Password' ) ) { $user_email = um_user( 'user_email' ); if ( mb_strlen( wp_unslash( $args['user_password'] ) ) < $min_length ) { + // translators: %s: min length. UM()->form()->add_error( 'user_password', sprintf( __( 'Your password must contain at least %d characters', 'ultimate-member' ), $min_length ) ); } if ( mb_strlen( wp_unslash( $args['user_password'] ) ) > $max_length ) { + // translators: %s: max length. UM()->form()->add_error( 'user_password', sprintf( __( 'Your password must contain less than %d characters', 'ultimate-member' ), $max_length ) ); } diff --git a/includes/core/class-uploader.php b/includes/core/class-uploader.php index 49cea88c..892ff986 100644 --- a/includes/core/class-uploader.php +++ b/includes/core/class-uploader.php @@ -791,8 +791,10 @@ if ( ! class_exists( 'um\core\Uploader' ) ) { } elseif ( isset( $data['max_file_size'] ) && ( $image_info['size'] > $data['max_file_size'] ) ) { $error = $data['max_file_size_error']; } elseif ( isset( $data['min_width'] ) && ( $image_info['width'] < $data['min_width'] ) ) { + // translators: %s: min widdth. $error = sprintf( __( 'Your photo is too small. It must be at least %spx wide.', 'ultimate-member' ), $data['min_width'] ); } elseif ( isset( $data['min_height'] ) && ( $image_info['height'] < $data['min_height'] ) ) { + // translators: %s: min height. $error = sprintf( __( 'Your photo is too small. It must be at least %spx high.', 'ultimate-member' ), $data['min_height'] ); } diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index ab08f406..39eca33e 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -503,7 +503,9 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { } } } catch ( Exception $e ) { + // translators: %s: title. UM()->form()->add_error( $key, sprintf( __( '%s - wrong conditions.', 'ultimate-member' ), $array['title'] ) ); + // translators: %s: title. $notice = '
' . sprintf( __( '%s - wrong conditions.', 'ultimate-member' ), $array['title'] ) . '
'; add_action( 'um_after_profile_fields', function() use ( $notice ) { echo $notice; @@ -512,14 +514,17 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { } if ( isset( $array['type'] ) && $array['type'] == 'checkbox' && isset( $array['required'] ) && $array['required'] == 1 && ! isset( $submitted_data[ $key ] ) ) { + // translators: %s: title. UM()->form()->add_error( $key, sprintf( __( '%s is required.', 'ultimate-member' ), $array['title'] ) ); } if ( isset( $array['type'] ) && $array['type'] == 'radio' && isset( $array['required'] ) && $array['required'] == 1 && ! isset( $submitted_data[ $key ] ) && ! in_array( $key, array( 'role_radio', 'role_select' ) ) ) { + // translators: %s: title. UM()->form()->add_error( $key, sprintf( __( '%s is required.', 'ultimate-member'), $array['title'] ) ); } if ( isset( $array['type'] ) && $array['type'] == 'multiselect' && isset( $array['required'] ) && $array['required'] == 1 && ! isset( $submitted_data[ $key ] ) && ! in_array( $key, array( 'role_radio', 'role_select' ) ) ) { + // translators: %s: title. UM()->form()->add_error( $key, sprintf( __( '%s is required.', 'ultimate-member' ), $array['title'] ) ); } @@ -557,6 +562,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { if ( empty( $array['label'] ) ) { UM()->form()->add_error( $key, __( 'This field is required', 'ultimate-member' ) ); } else { + // translators: %s: title. UM()->form()->add_error( $key, sprintf( __( '%s is required', 'ultimate-member' ), $array['label'] ) ); } } @@ -568,6 +574,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { if ( isset( $array['max_words'] ) && $array['max_words'] > 0 ) { if ( str_word_count( $submitted_data[ $key ], 0, "éèàôù" ) > $array['max_words'] ) { + // translators: %s: max words. UM()->form()->add_error( $key, sprintf( __( 'You are only allowed to enter a maximum of %s words', 'ultimate-member' ), $array['max_words'] ) ); } } @@ -575,9 +582,11 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { if ( isset( $array['min_chars'] ) && $array['min_chars'] > 0 ) { if ( $submitted_data[ $key ] && mb_strlen( $submitted_data[ $key ] ) < $array['min_chars'] ) { if ( empty( $array['label'] ) ) { + // translators: %s: min chars. UM()->form()->add_error( $key, sprintf( __( 'This field must contain at least %s characters', 'ultimate-member' ), $array['min_chars'] ) ); } else { - UM()->form()->add_error( $key, sprintf( __( 'Your %s must contain at least %s characters', 'ultimate-member' ), $array['label'], $array['min_chars'] ) ); + // translators: %1$s is a label; %2$s is a min chars. + UM()->form()->add_error( $key, sprintf( __( 'Your %1$s must contain at least %2$s characters', 'ultimate-member' ), $array['label'], $array['min_chars'] ) ); } } } @@ -585,9 +594,11 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { if ( isset( $array['max_chars'] ) && $array['max_chars'] > 0 ) { if ( $submitted_data[ $key ] && mb_strlen( $submitted_data[ $key ] ) > $array['max_chars'] ) { if ( empty( $array['label'] ) ) { + // translators: %s: max chars. UM()->form()->add_error( $key, sprintf( __( 'This field must contain less than %s characters', 'ultimate-member' ), $array['max_chars'] ) ); } else { - UM()->form()->add_error( $key, sprintf( __( 'Your %s must contain less than %s characters', 'ultimate-member' ), $array['label'], $array['max_chars'] ) ); + // translators: %1$s is a label; %2$s is a max chars. + UM()->form()->add_error( $key, sprintf( __( 'Your %1$s must contain less than %2$s characters', 'ultimate-member' ), $array['label'], $array['max_chars'] ) ); } } } @@ -629,24 +640,28 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { if ( isset( $array['min_selections'] ) && $array['min_selections'] > 0 ) { if ( ( ! isset( $submitted_data[ $key ] ) ) || ( isset( $submitted_data[ $key ] ) && is_array( $submitted_data[ $key ] ) && count( $submitted_data[ $key ] ) < $array['min_selections'] ) ) { + // translators: %s: min selections. UM()->form()->add_error( $key, sprintf( __( 'Please select at least %s choices', 'ultimate-member' ), $array['min_selections'] ) ); } } if ( isset( $array['max_selections'] ) && $array['max_selections'] > 0 ) { if ( isset( $submitted_data[ $key ] ) && is_array( $submitted_data[ $key ] ) && count( $submitted_data[ $key ] ) > $array['max_selections'] ) { + // translators: %s: max selections. UM()->form()->add_error( $key, sprintf( __( 'You can only select up to %s choices', 'ultimate-member' ), $array['max_selections'] ) ); } } if ( isset( $array['min'] ) && is_numeric( $submitted_data[ $key ] ) ) { if ( isset( $submitted_data[ $key ] ) && $submitted_data[ $key ] < $array['min'] ) { + // translators: %s: min limit. UM()->form()->add_error( $key, sprintf( __( 'Minimum number limit is %s', 'ultimate-member' ), $array['min'] ) ); } } if ( isset( $array['max'] ) && is_numeric( $submitted_data[ $key ] ) ) { if ( isset( $submitted_data[ $key ] ) && $submitted_data[ $key ] > $array['max'] ) { + // translators: %s: max limit. UM()->form()->add_error( $key, sprintf( __( 'Maximum number limit is %s', 'ultimate-member' ), $array['max'] ) ); } } @@ -697,36 +712,42 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { case 'youtube_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'youtube.com' ) && ! UM()->validation()->is_url( $submitted_data[ $key ], 'youtu.be' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s username or profile URL', 'ultimate-member' ), $array['label'] ) ); } break; case 'spotify_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'open.spotify.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s URL', 'ultimate-member' ), $array['label'] ) ); } break; case 'telegram_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 't.me' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s username or profile URL', 'ultimate-member' ), $array['label'] ) ); } break; case 'soundcloud_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'soundcloud.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s username or profile URL','ultimate-member'), $array['label'] ) ); } break; case 'facebook_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'facebook.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s username or profile URL', 'ultimate-member' ), $array['label'] ) ); } break; case 'twitter_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'twitter.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s username or profile URL', 'ultimate-member' ), $array['label'] ) ); } break; @@ -734,12 +755,14 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { case 'instagram_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'instagram.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s profile URL', 'ultimate-member' ), $array['label'] ) ); } break; case 'linkedin_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'linkedin.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s username or profile URL', 'ultimate-member' ), $array['label'] ) ); } break; @@ -753,6 +776,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { case 'tiktok_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'tiktok.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s profile URL', 'ultimate-member' ), $array['label'] ) ); } break; @@ -760,6 +784,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { case 'twitch_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'twitch.tv' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s profile URL', 'ultimate-member' ), $array['label'] ) ); } break; @@ -767,6 +792,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { case 'reddit_url': if ( ! UM()->validation()->is_url( $submitted_data[ $key ], 'reddit.com' ) ) { + // translators: %s: label. UM()->form()->add_error( $key, sprintf( __( 'Please enter a valid %s profile URL', 'ultimate-member' ), $array['label'] ) ); } break; @@ -911,6 +937,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { if ( $profile_show_bio ) { if ( mb_strlen( str_replace( array( "\r\n", "\n", "\r\t", "\t" ), ' ', $submitted_data['description'] ) ) > $max_chars && $max_chars ) { + // translators: %s: max chars. UM()->form()->add_error( 'description', sprintf( __( 'Your user description must contain less than %s characters', 'ultimate-member' ), $max_chars ) ); } } diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index b7b63ecf..7a6944dc 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -340,6 +340,7 @@ function um_user_edit_profile( $args, $form_data ) { } else { if ( 'password' === $array['type'] ) { $to_update[ $key ] = wp_hash_password( $args['submitted'][ $key ] ); + // translators: %s: title. $args['submitted'][ $key ] = sprintf( __( 'Your choosed %s', 'ultimate-member' ), $array['title'] ); } else { if ( isset( $userinfo[ $key ] ) && $args['submitted'][ $key ] != $userinfo[ $key ] ) { @@ -1233,7 +1234,12 @@ function um_profile_header( $args ) {
- + + +
options()->get( 'allow_url_redirect_confirm' ) && $value !== wp_validate_redirect( $value ) ) { $onclick_alert = sprintf( ' onclick="' . esc_attr( 'return confirm( "%s" );' ) . '"', + // translators: %s: link. esc_js( sprintf( __( 'This link leads to a 3rd-party website. Make sure the link is safe and you really want to go to this website: \'%s\'', 'ultimate-member' ), $value ) ) ); } diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 72193f57..955ac7d0 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -845,7 +845,8 @@ function um_user_submited_display( $k, $title, $data = array(), $style = true ) $output = ''; if ( 'form_id' === $k && ! empty( $data['form_id'] ) ) { - $v = sprintf( __( '%s - Form ID#: %s', 'ultimate-member' ), get_the_title( $data['form_id'] ), $data['form_id'] ); + // translators: %1$s is a form title; %2$s is a form ID. + $v = sprintf( __( '%1$s - Form ID#: %2$s', 'ultimate-member' ), get_the_title( $data['form_id'] ), $data['form_id'] ); } else { $v = um_user( $k ); } diff --git a/templates/members.php b/templates/members.php index b254d9f0..b29fe345 100644 --- a/templates/members.php +++ b/templates/members.php @@ -273,14 +273,15 @@ $postid = ! empty( $post->ID ) ? $post->ID : ''; if ( empty( $view_types ) ) { ?> c
- %2$s','ultimate-member' ), $link, $comment_title ); ?> + + %2$s','ultimate-member' ), $link, $comment_title ); + ?> +
diff --git a/templates/profile/posts-single.php b/templates/profile/posts-single.php index 7964e6e2..37dc2d1b 100644 --- a/templates/profile/posts-single.php +++ b/templates/profile/posts-single.php @@ -34,7 +34,10 @@ if ( ! defined( 'ABSPATH' ) ) {
- ID ), current_time( 'timestamp' ) ) ); ?> + ID ), current_time( 'timestamp' ) ) ); + ?> : ID ); ?> @@ -45,6 +48,7 @@ if ( ! defined( 'ABSPATH' ) ) { if ( $num_comments == 0 ) { $comments = __( 'no comments', 'ultimate-member' ); } elseif ( $num_comments > 1 ) { + // translators: %s: coments number. $comments = sprintf( __( '%s comments', 'ultimate-member' ), $num_comments ); } else { $comments = __( '1 comment', 'ultimate-member' );