|
6 | 6 |
|
7 | 7 | from django.core.exceptions import ValidationError
|
8 | 8 | from django.utils.encoding import force_str, smart_str
|
| 9 | +from django.utils.translation import ngettext |
9 | 10 |
|
10 | 11 | try:
|
11 | 12 | from django.utils.translation import gettext_lazy as _
|
12 |
| - from django.utils.translation import ngettext as ungettext |
13 | 13 | except ImportError:
|
14 | 14 | # Before in Django 3.0
|
15 | 15 | from django.utils.translation import ugettext_lazy as _
|
16 |
| - from django.utils.translation import ungettext |
17 | 16 |
|
18 | 17 | from password_policies.conf import settings
|
19 | 18 |
|
@@ -197,7 +196,7 @@ def __call__(self, value):
|
197 | 196 | if len(list(group)) > self.get_max_count():
|
198 | 197 | consecutive_found = True
|
199 | 198 | if consecutive_found:
|
200 |
| - msg = ungettext( |
| 199 | + msg = ngettext( |
201 | 200 | "The new password contains consecutive"
|
202 | 201 | " characters. Only %(count)d consecutive character"
|
203 | 202 | " is allowed.",
|
@@ -431,7 +430,7 @@ def get_error_message(self):
|
431 | 430 | """
|
432 | 431 | Returns this validator's error message."""
|
433 | 432 | msg = (
|
434 |
| - ungettext( |
| 433 | + ngettext( |
435 | 434 | "The new password must contain %d or more letter.",
|
436 | 435 | "The new password must contain %d or more letters.",
|
437 | 436 | self.get_min_count(),
|
@@ -472,7 +471,7 @@ def get_error_message(self):
|
472 | 471 | """
|
473 | 472 | Returns this validator's error message."""
|
474 | 473 | msg = (
|
475 |
| - ungettext( |
| 474 | + ngettext( |
476 | 475 | "The new password must contain %d or more lowercase letter.",
|
477 | 476 | "The new password must contain %d or more lowercase letters.",
|
478 | 477 | self.get_min_count(),
|
@@ -514,7 +513,7 @@ def get_error_message(self):
|
514 | 513 | """
|
515 | 514 | Returns this validator's error message."""
|
516 | 515 | msg = (
|
517 |
| - ungettext( |
| 516 | + ngettext( |
518 | 517 | "The new password must contain %d or more uppercase letter.",
|
519 | 518 | "The new password must contain %d or more uppercase letters.",
|
520 | 519 | self.get_min_count(),
|
@@ -598,7 +597,7 @@ def get_error_message(self):
|
598 | 597 | """
|
599 | 598 | Returns this validator's error message."""
|
600 | 599 | msg = (
|
601 |
| - ungettext( |
| 600 | + ngettext( |
602 | 601 | "The new password must contain %d or more number.",
|
603 | 602 | "The new password must contain %d or more numbers.",
|
604 | 603 | self.get_min_count(),
|
@@ -670,7 +669,7 @@ def get_error_message(self):
|
670 | 669 | """
|
671 | 670 | Returns this validator's error message."""
|
672 | 671 | msg = (
|
673 |
| - ungettext( |
| 672 | + ngettext( |
674 | 673 | "The new password must contain %d or more symbol.",
|
675 | 674 | "The new password must contain %d or more symbols.",
|
676 | 675 | self.get_min_count(),
|
|
0 commit comments