Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translations #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ htmlcov/
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

Expand Down
Binary file added defender/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
41 changes: 41 additions & 0 deletions defender/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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."
2 changes: 1 addition & 1 deletion defender/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 4 additions & 3 deletions defender/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.")
)


Expand Down