From b4b9668cab895e88edce16d21dd8a732e511b322 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 19 Mar 2021 09:05:29 -0400 Subject: [PATCH] Add translations --- .gitignore | 4 --- defender/locale/fr/LC_MESSAGES/django.mo | Bin 0 -> 1033 bytes defender/locale/fr/LC_MESSAGES/django.po | 41 +++++++++++++++++++++++ defender/tests.py | 2 +- defender/utils.py | 7 ++-- 5 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 defender/locale/fr/LC_MESSAGES/django.mo create mode 100644 defender/locale/fr/LC_MESSAGES/django.po diff --git a/.gitignore b/.gitignore index 1fd65aa..5e2a8c3 100644 --- a/.gitignore +++ b/.gitignore @@ -42,10 +42,6 @@ htmlcov/ nosetests.xml coverage.xml -# Translations -*.mo -*.pot - # Django stuff: *.log diff --git a/defender/locale/fr/LC_MESSAGES/django.mo b/defender/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..b4f17ef1359e66ec4492d28941cbe320265dfeb6 GIT binary patch literal 1033 zcmbVKJ#Q015IrCW$t87)p#p^VAXL%iLpkD0V&N}rCkVRD-QX(CZ?dE0(yGd z{02(@3?zOFZ*AnXh?SmZKW1m%%)H-sH@-($w}DNd4cq}rAgnLI3*ako0Q>?rfXy3G z^b+{2dhW&)|H(0ntFw6fi%bajutu)U~qdk=-f5$~a-WaN+ zp5tPwG)eEds=bTp&}c7nPZF0!g(q*Q(cv4-O=C%}0>#lkM;w+c9h0|nl2eI@rSxp$ z=)_bU{e5JOE0UBOYZ=)a$5zXVL8G8rI`_fYBBs9a2y`Jmog05aZxok>BWam(q!5m^ zQ(nzDj)vB}MIg~B#2H(sj815n9zIWxGdjygpXfr=x432bY4uX)D8t1o6yl|w@dxBm(gz4OFP|z zwA~(MWYScDo0qijAFK`+z~O)61@DZ^chqVJhg6n9OVN z@qFnY*Cl$nL-~cYj{V;0V2mq)kv zbca^ky$721Y3t!mD>^g~1k;SIHH|9E#T61;Q&WKvfQt-`cHxv8t@#q|TC0aYLNhD< zDCaGj2<6m4KE>i{9T5|s86SqXOcnoM$}, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-03-19 08:43-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: config.py:65 +msgid "" +"Please enter a correct username and password. Note that both fields are case-" +"sensitive." +msgstr "" +"Veuillez saisir un nom d'utilisateur et un mot de passe valide. Veuillez noter que les deux champs sont sensibles à la casse." + +#: templates/admin/defender/app_index.html:7 +msgid "Home" +msgstr "Accueil" + +#: utils.py:308 +msgid "Account locked: too many login attempts. Please try again later." +msgstr "Compte verrouillé: trop de tentatives de connexion. Veuillez réessayer plus tard." + +#: utils.py:312 +msgid "" +"Account locked: too many login attempts. Contact an admin to unlock your " +"account." +msgstr "" +"Compte verrouillé: trop de tentatives de connexion. Contactez un administrateur pour déverrouiller votre compte." diff --git a/defender/tests.py b/defender/tests.py index 491df36..d85cde7 100644 --- a/defender/tests.py +++ b/defender/tests.py @@ -37,7 +37,7 @@ class AccessAttemptTest(DefenderTestCase): LOCKED_MESSAGE = "Account locked: too many login attempts." PERMANENT_LOCKED_MESSAGE = ( - LOCKED_MESSAGE + " Contact an admin to unlock your account." + LOCKED_MESSAGE + " Contact an admin to unlock your account." ) def _get_random_str(self): diff --git a/defender/utils.py b/defender/utils.py index 3c195c7..5983ae4 100644 --- a/defender/utils.py +++ b/defender/utils.py @@ -6,6 +6,7 @@ from django.shortcuts import render from django.core.validators import validate_ipv46_address from django.core.exceptions import ValidationError from django.utils.module_loading import import_string +from django.utils.translation import gettext as _ from .connection import get_redis_connection from . import config @@ -304,12 +305,12 @@ def lockout_response(request): if config.COOLOFF_TIME: return HttpResponse( - "Account locked: too many login attempts. " "Please try again later." + _("Account locked: too many login attempts. Please try again later.") ) else: return HttpResponse( - "Account locked: too many login attempts. " - "Contact an admin to unlock your account." + _("Account locked: too many login attempts. " + "Contact an admin to unlock your account.") )