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 0000000..b4f17ef Binary files /dev/null and b/defender/locale/fr/LC_MESSAGES/django.mo differ diff --git a/defender/locale/fr/LC_MESSAGES/django.po b/defender/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000..fef0287 --- /dev/null +++ b/defender/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , 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.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.") )