Python django.utils.translation.gettext_noop() Examples
The following are 20
code examples of django.utils.translation.gettext_noop().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
django.utils.translation
, or try the search function
.
Example #1
Source File: problems.py From online-judge with GNU Affero General Public License v3.0 | 6 votes |
def _get_result_data(results): return { 'categories': [ # Using gettext_noop here since this will be tacked into the cache, so it must be language neutral. # The caller, SubmissionList.get_result_data will run ugettext on the name. {'code': 'AC', 'name': gettext_noop('Accepted'), 'count': results['AC']}, {'code': 'WA', 'name': gettext_noop('Wrong'), 'count': results['WA']}, {'code': 'CE', 'name': gettext_noop('Compile Error'), 'count': results['CE']}, {'code': 'TLE', 'name': gettext_noop('Timeout'), 'count': results['TLE']}, {'code': 'ERR', 'name': gettext_noop('Error'), 'count': results['MLE'] + results['OLE'] + results['IR'] + results['RTE'] + results['AB'] + results['IE']}, ], 'total': sum(results.values()), }
Example #2
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): (algorithm, variety, version, time_cost, memory_cost, parallelism, salt, data) = self._decode(encoded) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('variety'), variety), (_('version'), version), (_('memory cost'), memory_cost), (_('time cost'), time_cost), (_('parallelism'), parallelism), (_('salt'), mask_hash(salt)), (_('hash'), mask_hash(data)), ])
Example #3
Source File: test_strings.py From django-i18nfield with Apache License 2.0 | 5 votes |
def test_from_gettext(): gstr = gettext_noop('Welcome') lstr = LazyI18nString.from_gettext(gstr) assert 'de' in lstr.data assert lstr.data['en'] == 'Welcome'
Example #4
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, salt, data = encoded.split('$', 2) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('salt'), salt), (_('hash'), mask_hash(data, show=3)), ])
Example #5
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): return OrderedDict([ (_('algorithm'), self.algorithm), (_('hash'), mask_hash(encoded, show=3)), ])
Example #6
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): assert encoded.startswith('sha1$$') hash = encoded[6:] return OrderedDict([ (_('algorithm'), self.algorithm), (_('hash'), mask_hash(hash)), ])
Example #7
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, salt, hash = encoded.split('$', 2) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('salt'), mask_hash(salt, show=2)), (_('hash'), mask_hash(hash)), ])
Example #8
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def harden_runtime(self, password, encoded): _, data = encoded.split('$', 1) salt = data[:29] # Length of the salt in bcrypt. rounds = data.split('$')[2] # work factor is logarithmic, adding one doubles the load. diff = 2**(self.rounds - int(rounds)) - 1 while diff > 0: self.encode(password, salt.encode('ascii')) diff -= 1
Example #9
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, empty, algostr, work_factor, data = encoded.split('$', 4) assert algorithm == self.algorithm salt, checksum = data[:22], data[22:] return OrderedDict([ (_('algorithm'), algorithm), (_('work factor'), work_factor), (_('salt'), mask_hash(salt)), (_('checksum'), mask_hash(checksum)), ])
Example #10
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): (algorithm, variety, version, time_cost, memory_cost, parallelism, salt, data) = self._decode(encoded) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('variety'), variety), (_('version'), version), (_('memory cost'), memory_cost), (_('time cost'), time_cost), (_('parallelism'), parallelism), (_('salt'), mask_hash(salt)), (_('hash'), mask_hash(data)), ])
Example #11
Source File: hashers.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, iterations, salt, hash = encoded.split('$', 3) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('iterations'), iterations), (_('salt'), mask_hash(salt)), (_('hash'), mask_hash(hash)), ])
Example #12
Source File: initdb.py From zing with GNU General Public License v3.0 | 5 votes |
def create_pootle_permissions(self): """Create Pootle's directory level permissions.""" args = { "app_label": "pootle_app", "model": "directory", } pootle_content_type = self._create_object(ContentType, **args)[0] pootle_content_type.save() # Create the permissions. permissions = [ {"name": _("Can access a project"), "codename": "view"}, {"name": _("Cannot access a project"), "codename": "hide"}, { "name": _("Can make a suggestion for a translation"), "codename": "suggest", }, {"name": _("Can submit a translation"), "codename": "translate"}, {"name": _("Can review suggestions"), "codename": "review"}, { "name": _("Can perform administrative tasks"), "codename": "administrate", }, ] criteria = { "content_type": pootle_content_type, } for permission in permissions: criteria.update(permission) self._create_object(Permission, **criteria)
Example #13
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, salt, data = encoded.split('$', 2) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('salt'), salt), (_('hash'), mask_hash(data, show=3)), ])
Example #14
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): return OrderedDict([ (_('algorithm'), self.algorithm), (_('hash'), mask_hash(encoded, show=3)), ])
Example #15
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): assert encoded.startswith('sha1$$') hash = encoded[6:] return OrderedDict([ (_('algorithm'), self.algorithm), (_('hash'), mask_hash(hash)), ])
Example #16
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, salt, hash = encoded.split('$', 2) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('salt'), mask_hash(salt, show=2)), (_('hash'), mask_hash(hash)), ])
Example #17
Source File: hashers.py From bioforum with MIT License | 5 votes |
def harden_runtime(self, password, encoded): _, data = encoded.split('$', 1) salt = data[:29] # Length of the salt in bcrypt. rounds = data.split('$')[2] # work factor is logarithmic, adding one doubles the load. diff = 2**(self.rounds - int(rounds)) - 1 while diff > 0: self.encode(password, force_bytes(salt)) diff -= 1
Example #18
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, empty, algostr, work_factor, data = encoded.split('$', 4) assert algorithm == self.algorithm salt, checksum = data[:22], data[22:] return OrderedDict([ (_('algorithm'), algorithm), (_('work factor'), work_factor), (_('salt'), mask_hash(salt)), (_('checksum'), mask_hash(checksum)), ])
Example #19
Source File: hashers.py From bioforum with MIT License | 5 votes |
def safe_summary(self, encoded): algorithm, iterations, salt, hash = encoded.split('$', 3) assert algorithm == self.algorithm return OrderedDict([ (_('algorithm'), algorithm), (_('iterations'), iterations), (_('salt'), mask_hash(salt)), (_('hash'), mask_hash(hash)), ])
Example #20
Source File: create_notice_types.py From horas with MIT License | 4 votes |
def handle(self, *args, **options): NoticeType.create( "create_meeting_slot", _("Periodo de reunion creada"), _("tu periodo de reunion esta lista"), ) NoticeType.create( "reserved_meeting_slot", _("Reunion aceptada"), _("tu reunion ha sido aceptada"), ) NoticeType.create( "cancelled_by_mentor", _("Reunion cancelada por el mentor"), _("tu reunion ha sido cancelada"), ) NoticeType.create( "cancelled_by_protege", _("Reunion cacelada por aprendiz"), _("your meeting has been cancelled"), ) NoticeType.create( "confirmed_meeting", _("Reunion confirmada"), _("su reunion ha sido confirmada"), ) NoticeType.create( "post_meeting_mentor", _("Dejenos saber"), _("como le fue en su reunion?") ) NoticeType.create( "post_meeting_protege", _("Dejenos saber"), _("como le fue en su reunion?") ) NoticeType.create( "comment", _("Comentario nuevo"), _("tienes un nuevo comentario") ) self.stdout.write("--> Created notice types")