From 4226b6d0e1bce12549320c40fe4669ff094d486c Mon Sep 17 00:00:00 2001 From: Chris Garcia Date: Fri, 28 Oct 2016 15:23:18 -0500 Subject: [PATCH] Corrected use of 'lowercase' and 'uppercase' to fix #1515 --- applications/admin/languages/nl.py | 4 ++-- applications/admin/languages/uk.py | 4 ++-- applications/admin/static/codemirror/keymap/vim.js | 6 +++--- gluon/tests/test_validators.py | 8 ++++---- gluon/validators.py | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/applications/admin/languages/nl.py b/applications/admin/languages/nl.py index 55d95be4..9998ee62 100755 --- a/applications/admin/languages/nl.py +++ b/applications/admin/languages/nl.py @@ -352,9 +352,9 @@ 'modules': 'modules', 'Multi User Mode': 'Multi User Mode', 'Must include at least %s %s': 'Moet ten minste bevatten %s %s', -'Must include at least %s lower case': 'Moet ten minste bevatten %s lower case', +'Must include at least %s lowercase': 'Moet ten minste bevatten %s kleine letter', 'Must include at least %s of the following : %s': 'Moet ten minste bevatten %s van het volgende : %s', -'Must include at least %s upper case': 'Moet ten minste bevatten %s upper case', +'Must include at least %s uppercase': 'Moet ten minste bevatten %s hoofdletter', 'new application "%s" created': 'nieuwe applicatie "%s" gemaakt', 'new application "%s" imported': 'new application "%s" imported', 'New Application Wizard': 'Nieuwe Applicatie Wizard', diff --git a/applications/admin/languages/uk.py b/applications/admin/languages/uk.py index a45124c6..e1462848 100755 --- a/applications/admin/languages/uk.py +++ b/applications/admin/languages/uk.py @@ -356,9 +356,9 @@ 'modules': 'модулі', 'Multi User Mode': 'Multi User Mode', 'Must include at least %s %s': 'Має вміщувати щонайменше %s %s', -'Must include at least %s lower case': 'Повинен включати щонайменше %s малих букв', +'Must include at least %s lowercase': 'Повинен включати щонайменше %s малих букв', 'Must include at least %s of the following : %s': 'Має включати не менше %s таких символів : %s', -'Must include at least %s upper case': 'Повинен включати щонайменше %s великих букв', +'Must include at least %s uppercase': 'Повинен включати щонайменше %s великих букв', 'new application "%s" created': 'новий додаток "%s" створено', 'new application "%s" imported': 'new application "%s" imported', 'New Application Wizard': 'Майстер створення нового додатку', diff --git a/applications/admin/static/codemirror/keymap/vim.js b/applications/admin/static/codemirror/keymap/vim.js index 682eb7a8..a4c31910 100644 --- a/applications/admin/static/codemirror/keymap/vim.js +++ b/applications/admin/static/codemirror/keymap/vim.js @@ -314,8 +314,8 @@ // Vim does not support modifier only keys. return false; } - // TODO: Current bindings expect the character to be lower case, but - // it looks like vim key notation uses upper case. + // TODO: Current bindings expect the character to be lowercase, but + // it looks like vim key notation uses uppercase. if (isUpperCase(lastPiece)) { pieces[pieces.length - 1] = lastPiece.toLowerCase(); } @@ -3644,7 +3644,7 @@ * Extract the regular expression from the query and return a Regexp object. * Returns null if the query is blank. * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. - * If smartCase is passed in, and the query contains upper case letters, + * If smartCase is passed in, and the query contains uppercase letters, * then ignoreCase is overridden, and the 'i' flag will not be set. * If the query contains the /i in the flag part of the regular expression, * then both ignoreCase and smartCase are ignored, and 'i' will be passed diff --git a/gluon/tests/test_validators.py b/gluon/tests/test_validators.py index c98b4c26..49d4f905 100644 --- a/gluon/tests/test_validators.py +++ b/gluon/tests/test_validators.py @@ -843,7 +843,7 @@ class TestValidators(unittest.TestCase): '|'.join(['Minimum length is 8', 'Maximum length is 4', 'Must include at least 1 of the following: ~!@#$%^&*()_+-=?<>,.:;{}[]|', - 'Must include at least 1 upper case', + 'Must include at least 1 uppercase', 'Must include at least 1 number'])) ) rtn = IS_STRONG(es=True)('abcde') @@ -851,7 +851,7 @@ class TestValidators(unittest.TestCase): ('abcde', '|'.join(['Minimum length is 8', 'Must include at least 1 of the following: ~!@#$%^&*()_+-=?<>,.:;{}[]|', - 'Must include at least 1 upper case', + 'Must include at least 1 uppercase', 'Must include at least 1 number'])) ) rtn = IS_STRONG(upper=0, lower=0, number=0, es=True)('Abcde1') @@ -859,8 +859,8 @@ class TestValidators(unittest.TestCase): ('Abcde1', '|'.join(['Minimum length is 8', 'Must include at least 1 of the following: ~!@#$%^&*()_+-=?<>,.:;{}[]|', - 'May not include any upper case letters', - 'May not include any lower case letters', + 'May not include any uppercase letters', + 'May not include any lowercase letters', 'May not include any numbers'])) ) diff --git a/gluon/validators.py b/gluon/validators.py index 4181c226..22ad1a75 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -2470,7 +2470,7 @@ class IS_LIST_OF(Validator): class IS_LOWER(Validator): """ - Converts to lower case:: + Converts to lowercase:: >>> IS_LOWER()('ABC') ('abc', None) @@ -2485,7 +2485,7 @@ class IS_LOWER(Validator): class IS_UPPER(Validator): """ - Converts to upper case:: + Converts to uppercase:: >>> IS_UPPER()('abc') ('ABC', None) @@ -3025,22 +3025,22 @@ class IS_STRONG(object): all_upper = re.findall("[A-Z]", value) if self.upper > 0: if not len(all_upper) >= self.upper: - failures.append(translate("Must include at least %s upper case") + failures.append(translate("Must include at least %s uppercase") % str(self.upper)) else: if len(all_upper) > 0: failures.append( - translate("May not include any upper case letters")) + translate("May not include any uppercase letters")) if isinstance(self.lower, int): all_lower = re.findall("[a-z]", value) if self.lower > 0: if not len(all_lower) >= self.lower: - failures.append(translate("Must include at least %s lower case") + failures.append(translate("Must include at least %s lowercase") % str(self.lower)) else: if len(all_lower) > 0: failures.append( - translate("May not include any lower case letters")) + translate("May not include any lowercase letters")) if isinstance(self.number, int): all_number = re.findall("[0-9]", value) if self.number > 0: