Skip to content

Commit

Permalink
Merge pull request #1476 from sapayth/fix/translation_for_password_st…
Browse files Browse the repository at this point in the history
…rength

fix: translation for password strength
  • Loading branch information
sapayth authored Sep 6, 2024
2 parents 49a2c9f + 745bc9f commit f109638
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 19 deletions.
6 changes: 3 additions & 3 deletions assets/js/frontend-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,19 +679,19 @@
errors.push({
type: 'custom',
container: item,
message: 'Password minimum strength should be weak'
message: wpuf_frontend.password_warning_weak
});
} else if (strength === 'medium' && strengthMeter < 3) {
errors.push({
type: 'custom',
container: item,
message: 'Password minimum strength should be medium'
message: wpuf_frontend.password_warning_medium
});
} else if (strength === 'strong' && strengthMeter < 4) {
errors.push({
type: 'custom',
container: item,
message: 'Password strength should be strong'
message: wpuf_frontend.password_warning_strong
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend-form.min.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions includes/Fields/Form_Field_Post_Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ class Form_Field_Post_Taxonomy extends Field_Contract {

protected $form_id;

/**
* @var mixed|string
*/
private $exclude_type;

/**
* @var mixed
*/
private $exclude;

public function __construct( $tax_name, $taxonomy, $post_id = null, $user_id = null ) {
//phpcs:ignore
$this->name = __( ucfirst( $tax_name ), 'wp-user-frontend' );
Expand Down
4 changes: 4 additions & 0 deletions includes/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ public function enqueue_scripts() {
'wp-user-frontend'
),
'protected_shortcodes' => wpuf_get_protected_shortcodes(),
// translators: %shortcode% is the shortcode name
'protected_shortcodes_message' => __( 'Using %shortcode% is restricted', 'wp-user-frontend' ),
'password_warning_weak' => __( 'Your password should be at least weak in strength', 'wp-user-frontend' ),
'password_warning_medium' => __( 'Your password needs to be medium strength for better protection', 'wp-user-frontend' ),
'password_warning_strong' => __( 'Create a strong password for maximum security', 'wp-user-frontend' ),
]
)
);
Expand Down
43 changes: 28 additions & 15 deletions languages/wp-user-frontend.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP User Frontend 4.0.10\n"
"Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
"POT-Creation-Date: 2024-08-22 03:44:53+00:00\n"
"POT-Creation-Date: 2024-09-05 05:07:35+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -1456,13 +1456,13 @@ msgstr ""
msgid "Strength indicator"
msgstr ""

#: class/render-form.php:1413 includes/Fields/Form_Field_Post_Taxonomy.php:134
#: includes/Fields/Form_Field_Post_Taxonomy.php:264
#: class/render-form.php:1413 includes/Fields/Form_Field_Post_Taxonomy.php:144
#: includes/Fields/Form_Field_Post_Taxonomy.php:274
#: includes/Render_Form.php:1270
msgid "-- Select --"
msgstr ""

#: class/render-form.php:1477 includes/Fields/Form_Field_Post_Taxonomy.php:73
#: class/render-form.php:1477 includes/Fields/Form_Field_Post_Taxonomy.php:83
#: includes/Render_Form.php:1334
msgid "This field is no longer available."
msgstr ""
Expand Down Expand Up @@ -2420,7 +2420,7 @@ msgstr ""
#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php:185
msgid ""
"Event has been updated successfully. <a target=\"_blank\" "
"href=\"%link%\">View event</a>"
"href=\"{link}\">View event</a>"
msgstr ""

#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php:188
Expand Down Expand Up @@ -2457,7 +2457,7 @@ msgstr ""
#: includes/Fields/Field_Contract.php:235
#: includes/Fields/Form_Field_Dropdown.php:108
#: includes/Fields/Form_Field_MultiDropdown.php:85
#: includes/Fields/Form_Field_Post_Taxonomy.php:461
#: includes/Fields/Form_Field_Post_Taxonomy.php:471
msgid "- select -"
msgstr ""

Expand Down Expand Up @@ -2489,7 +2489,7 @@ msgstr ""
#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:151
msgid ""
"Post has been updated successfully. <a target=\"_blank\" "
"href=\"%link%\">View post</a>"
"href=\"{link}\">View post</a>"
msgstr ""

#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:153
Expand Down Expand Up @@ -2649,15 +2649,15 @@ msgstr ""
msgid " Add Form"
msgstr ""

#: includes/Admin/Upgrades.php:121
#: includes/Admin/Upgrades.php:120
msgid "WPUF Data Update Required"
msgstr ""

#: includes/Admin/Upgrades.php:122
#: includes/Admin/Upgrades.php:121
msgid "Run the updater"
msgstr ""

#: includes/Admin/Upgrades.php:127
#: includes/Admin/Upgrades.php:126
msgid ""
"It is strongly recommended that you backup your database before proceeding. "
"Are you sure you wish to run the updater now?"
Expand Down Expand Up @@ -3118,7 +3118,7 @@ msgstr ""
msgid "Import"
msgstr ""

#: includes/Ajax/Address_Form_Ajax.php:40 includes/Frontend.php:154
#: includes/Ajax/Address_Form_Ajax.php:40 includes/Frontend.php:158
msgid "Some Required Fields are not filled!"
msgstr ""

Expand Down Expand Up @@ -4963,19 +4963,32 @@ msgid ""
"character."
msgstr ""

#: includes/Frontend.php:138
#: includes/Frontend.php:139
#. translators: %shortcode% is the shortcode name
msgid "Using %shortcode% is restricted"
msgstr ""

#: includes/Frontend.php:144
#: includes/Frontend.php:140
msgid "Password minimum strength should be weak"
msgstr ""

#: includes/Frontend.php:141
msgid "Password minimum strength should be medium"
msgstr ""

#: includes/Frontend.php:142
msgid "Password minimum strength should be strong"
msgstr ""

#: includes/Frontend.php:148
msgid "is required"
msgstr ""

#: includes/Frontend.php:145
#: includes/Frontend.php:149
msgid "does not match"
msgstr ""

#: includes/Frontend.php:146
#: includes/Frontend.php:150
msgid "is not valid"
msgstr ""

Expand Down

0 comments on commit f109638

Please sign in to comment.