itzulpenak

This commit is contained in:
aitzol 2022-04-25 17:20:59 +02:00
parent 6d30add55e
commit 7039f1373b
14 changed files with 95 additions and 80 deletions

34
app.py
View File

@ -113,9 +113,9 @@ def post_user():
return index_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str) return index_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str)
if len(form('username')) < 3: if len(form('username')) < 3:
return error(i18n.msg[1]) return error(i18n.msg[2])
elif not tools.input_validation(form('username')): elif not tools.input_validation(form('username')):
return error(i18n.msg[6]) return error(i18n.msg[3])
if not tools.pwd_validation(form('password')): if not tools.pwd_validation(form('password')):
return error(i18n.msg[21]) return error(i18n.msg[21])
@ -126,7 +126,7 @@ def post_user():
LOG.warning("Unsuccessful attempt to login %s: %s" % (form('username'), e)) LOG.warning("Unsuccessful attempt to login %s: %s" % (form('username'), e))
return error(str(e)) return error(str(e))
return user_tpl(alerts=[('success', '%s %s' % (i18n.msg[3], form('username').capitalize()), 'fadeOut' )], data=newSession().get(), str=i18n.str) return user_tpl(alerts=[('success', '%s %s' % (i18n.msg[1], form('username').capitalize()), 'fadeOut' )], data=newSession().get(), str=i18n.str)
@post('/signup') @post('/signup')
def post_signup(): def post_signup():
@ -152,14 +152,14 @@ def post_signup():
return signup_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str) return signup_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str)
if not tools.code_is_valid(form('invite_code'), db): if not tools.code_is_valid(form('invite_code'), db):
return(error(i18n.msg[4])) return(error(i18n.msg[6]))
if len(form('username')) < 3: if len(form('username')) < 3:
return error(i18n.msg[5]) return error(i18n.msg[2])
username = form('username').lower() username = form('username').lower()
if not tools.input_validation(username): if not tools.input_validation(username):
return error(i18n.msg[6]) return error(i18n.msg[3])
if len(form('firstname')) == 0: if len(form('firstname')) == 0:
firstname = auto_complete('firstname') firstname = auto_complete('firstname')
@ -175,7 +175,7 @@ def post_signup():
email = form('email').lower() email = form('email').lower()
if not tools.email_validation(email): if not tools.email_validation(email):
return error(i18n.msg[14]) return error(i18n.msg[15])
if not tools.pwd_validation(form('password')): if not tools.pwd_validation(form('password')):
return error(i18n.msg[8]) #mezua ALDATU egin behar da return error(i18n.msg[8]) #mezua ALDATU egin behar da
@ -216,12 +216,12 @@ def post_edit_fullname():
if len(form('firstname')) < 3: if len(form('firstname')) < 3:
return error(i18n.msg[11]) return error(i18n.msg[11])
elif not tools.input_validation(form('firstname')): elif not tools.input_validation(form('firstname')):
return error(i18n.msg[6]) #Not allowed characters for the firstname field. ALDATU return error(i18n.msg[4])
if len(form('surname')) < 3: if len(form('surname')) < 3:
return error(i18n.msg[12]) return error(i18n.msg[12])
elif not tools.input_validation(form('surname')): elif not tools.input_validation(form('surname')):
return error(i18n.msg[6]) #Not allowed characters for the surname field. ALDATU return error(i18n.msg[5])
try: try:
edit_fullname(username, old_firstname, old_surname, form('firstname').lower(), form('surname').lower()) edit_fullname(username, old_firstname, old_surname, form('firstname').lower(), form('surname').lower())
@ -269,7 +269,9 @@ def post_change_pwd():
def error(msg): def error(msg):
return change_pwd_tpl(username=username, alerts=[('error', msg, 'fadeOut')], str=i18n.str) return change_pwd_tpl(username=username, alerts=[('error', msg, 'fadeOut')], str=i18n.str)
if (not tools.pwd_validation(form('new-password')) or not tools.pwd_validation(form('confirm-password'))): if not tools.pwd_validation(form('old-password')):
return error(i18n.msg[26])
elif (not tools.pwd_validation(form('new-password')) or not tools.pwd_validation(form('confirm-password'))):
return error(i18n.msg[8]) #mezua aldatu egin behar da return error(i18n.msg[8]) #mezua aldatu egin behar da
elif form('new-password') != form('confirm-password'): elif form('new-password') != form('confirm-password'):
return error(i18n.msg[7]) return error(i18n.msg[7])
@ -369,7 +371,7 @@ def login_user(conf, *args):
except LDAPSocketOpenError as e: except LDAPSocketOpenError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
raise Error(i18n.msg[22]) raise Error(i18n.msg[23])
except LDAPExceptionError as e: except LDAPExceptionError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
@ -417,7 +419,7 @@ def logout_user(conf, *args):
except LDAPSocketOpenError as e: except LDAPSocketOpenError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
raise Error(i18n.msg[22]) raise Error(i18n.msg[23])
except LDAPExceptionError as e: except LDAPExceptionError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
@ -543,7 +545,7 @@ def new_fullname(conf, *args):
except LDAPSocketOpenError as e: except LDAPSocketOpenError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
raise Error(i18n.msg[22]) raise Error(i18n.msg[23])
except LDAPExceptionError as e: except LDAPExceptionError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
@ -606,7 +608,7 @@ def new_email_address(conf, *args):
except LDAPSocketOpenError as e: except LDAPSocketOpenError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
raise Error(i18n.msg[22]) raise Error(i18n.msg[23])
except LDAPExceptionError as e: except LDAPExceptionError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
@ -664,7 +666,7 @@ def change_password(conf, *args):
except LDAPSocketOpenError as e: except LDAPSocketOpenError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
raise Error(i18n.msg[22]) raise Error(i18n.msg[23])
except LDAPExceptionError as e: except LDAPExceptionError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
@ -714,7 +716,7 @@ def del_account(conf, *args):
except LDAPSocketOpenError as e: except LDAPSocketOpenError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))
raise Error(i18n.msg[22]) raise Error(i18n.msg[23])
except LDAPExceptionError as e: except LDAPExceptionError as e:
LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) LOG.error('{}: {!s}'.format(e.__class__.__name__, e))

Binary file not shown.

View File

@ -18,7 +18,7 @@
<form name="editEmailForm" method="post" action="/edit_email"> <form name="editEmailForm" method="post" action="/edit_email">
<label for="email">{{ str['email'] }}</label> <label for="email">{{ str['email'] }}</label>
<input id="email" name="email" type="text" value="{{ data['mail'] }}" > <input id="email" name="email" type="text" value="{{ data['mail'] }}" required>
<div class="form-buttons"> <div class="form-buttons">
<a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a> <a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a>

View File

@ -18,10 +18,10 @@
<form name="fullNameForm" method="post" action="/edit_fullname"> <form name="fullNameForm" method="post" action="/edit_fullname">
<label for="firstname">{{ str['fn'] }}</label> <label for="firstname">{{ str['fn'] }}</label>
<input id="firstname" name="firstname" type="text" value="{{ data['firstname'] }}"> <input id="firstname" name="firstname" type="text" value="{{ data['firstname'] }}" required>
<label for="surname">{{ str['sn'] }}</label> <label for="surname">{{ str['sn'] }}</label>
<input id="surname" name="surname" type="text" value="{{ data['surname'] }}" > <input id="surname" name="surname" type="text" value="{{ data['surname'] }}" required>
<div class="form-buttons"> <div class="form-buttons">
<a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a> <a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a>

View File

@ -36,14 +36,14 @@ class LocalizeTo(object):
#messages #messages
msg_00 = _("The session was closed.") msg_00 = _("The session was closed.")
msg_01 = _("Username must be at least 3 characters long!") msg_01 = _("Welcome")
msg_02 = _("Please enter your password!") msg_02 = _("Username must be at least 3 characters long!")
msg_03 = _("Welcome") msg_03 = _("Not allowed characters for the username field.")
msg_04 = _("The code is invalid or has expired.") msg_04 = _("Not allowed characters for the firstname field.")
msg_05 = _("A bit short, don't you think?!") msg_05 = _("Not allowed characters for the surname field.")
msg_06 = _("Not allowed characters for the username field.") msg_06 = _("The code is invalid or has expired.")
msg_07 = _("Passwords do not match!") msg_07 = _("Passwords do not match!")
msg_08 = _("Password must be at least 8 characters long!") msg_08 = _("The password must contain at least 8 characters, at least one number, uppercase and lowercase letters and special characters.")
msg_09 = _("Congratulations, your account has been created!") msg_09 = _("Congratulations, your account has been created!")
msg_10 = _("Your first and last name have not been changed.") msg_10 = _("Your first and last name have not been changed.")
msg_11 = _("Your firstname is a bit short, don't you think?") msg_11 = _("Your firstname is a bit short, don't you think?")

View File

@ -1,20 +1,20 @@
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <aitzol@lainoa.eus>, 2022. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.0.1\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-07 17:23+0200\n" "POT-Creation-Date: 2022-04-25 16:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Aitzol Berasategi <aitzol@lainoa.eus>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EU@eu.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: libs/localization.py:12 #: libs/localization.py:12
@ -109,7 +109,7 @@ msgstr ""
msgid "Delete your account" msgid "Delete your account"
msgstr "" msgstr ""
#: libs/localization.py:35 libs/localization.py:41 #: libs/localization.py:35 libs/localization.py:39
msgid "Welcome" msgid "Welcome"
msgstr "" msgstr ""
@ -117,24 +117,24 @@ msgstr ""
msgid "The session was closed." msgid "The session was closed."
msgstr "" msgstr ""
#: libs/localization.py:39 #: libs/localization.py:40
msgid "Username must be at least 3 characters long!" msgid "Username must be at least 3 characters long!"
msgstr "" msgstr ""
#: libs/localization.py:40 #: libs/localization.py:41
msgid "Please enter your password!" msgid "Not allowed characters for the username field."
msgstr "" msgstr ""
#: libs/localization.py:42 #: libs/localization.py:42
msgid "The code is invalid or has expired." msgid "Not allowed characters for the firstname field."
msgstr "" msgstr ""
#: libs/localization.py:43 #: libs/localization.py:43
msgid "A bit short, don't you think?!" msgid "Not allowed characters for the surname field."
msgstr "" msgstr ""
#: libs/localization.py:44 #: libs/localization.py:44
msgid "Not allowed characters for the username field." msgid "The code is invalid or has expired."
msgstr "" msgstr ""
#: libs/localization.py:45 #: libs/localization.py:45
@ -142,7 +142,9 @@ msgid "Passwords do not match!"
msgstr "" msgstr ""
#: libs/localization.py:46 #: libs/localization.py:46
msgid "Password must be at least 8 characters long!" msgid ""
"The password must contain at least 8 characters, at least one number, "
"uppercase and lowercase letters and special characters."
msgstr "" msgstr ""
#: libs/localization.py:47 #: libs/localization.py:47
@ -220,4 +222,4 @@ msgstr ""
#: libs/localization.py:65 #: libs/localization.py:65
msgid "The session has expired." msgid "The session has expired."
msgstr "" msgstr ""

Binary file not shown.

View File

@ -7,11 +7,11 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.0.1\n" "Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-07 17:23+0200\n" "POT-Creation-Date: 2022-04-07 17:20+0200\n"
"PO-Revision-Date: 2022-04-16 17:11+0200\n" "PO-Revision-Date: 2022-04-25 17:15+0200\n"
"Last-Translator: Aitzol Berasategi <aitzol@lainoa.eus>\n" "Last-Translator: Aitzol Berasategi <aitzol@lainoa.eus>\n"
"Language-Team: LANGUAGE <EU@eu.org>\n" "Language-Team: LANGUAGE <EN@en.org>\n"
"Language: en\n" "Language: eu\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -109,7 +109,7 @@ msgstr "Change your password"
msgid "Delete your account" msgid "Delete your account"
msgstr "Delete your account" msgstr "Delete your account"
#: libs/localization.py:35 libs/localization.py:41 #: libs/localization.py:35 libs/localization.py:39
msgid "Welcome" msgid "Welcome"
msgstr "Welcome" msgstr "Welcome"
@ -117,33 +117,37 @@ msgstr "Welcome"
msgid "The session was closed." msgid "The session was closed."
msgstr "The session was closed." msgstr "The session was closed."
#: libs/localization.py:39 #: libs/localization.py:40
msgid "Username must be at least 3 characters long!" msgid "Username must be at least 3 characters long!"
msgstr "Username must be at least 3 characters long!" msgstr "Username must be at least 3 characters long!"
#: libs/localization.py:40 #: libs/localization.py:41
msgid "Please enter your password!"
msgstr "Please enter your password!"
#: libs/localization.py:42
msgid "The code is invalid or has expired."
msgstr "The code is invalid or has expired."
#: libs/localization.py:43
msgid "A bit short, don't you think?!"
msgstr "A bit short, don't you think?!"
#: libs/localization.py:44
msgid "Not allowed characters for the username field." msgid "Not allowed characters for the username field."
msgstr "Not allowed characters for the username field." msgstr "Not allowed characters for the username field."
#: libs/localization.py:42
msgid "Not allowed characters for the firstname field."
msgstr "Not allowed characters for the firstname field."
#: libs/localization.py:43
msgid "Not allowed characters for the surname field."
msgstr "Not allowed characters for the surname field."
#: libs/localization.py:44
msgid "The code is invalid or has expired."
msgstr "The code is invalid or has expired."
#: libs/localization.py:45 #: libs/localization.py:45
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Passwords do not match!" msgstr "Passwords do not match!"
#: libs/localization.py:46 #: libs/localization.py:46
msgid "Password must be at least 8 characters long!" msgid ""
msgstr "Password must be at least 8 characters long!" "The password must contain at least 8 characters, at least one number, "
"uppercase and lowercase letters and special characters."
msgstr ""
"The password must contain at least 8 characters, at least one number, "
"uppercase and lowercase letters and special characters."
#: libs/localization.py:47 #: libs/localization.py:47
msgid "Congratulations, your account has been created!" msgid "Congratulations, your account has been created!"
@ -202,8 +206,10 @@ msgid "Unable to connect to the remote server."
msgstr "Unable to connect to the remote server." msgstr "Unable to connect to the remote server."
#: libs/localization.py:61 #: libs/localization.py:61
msgid "Encountered an unexpected error while communicating with the remote server." msgid ""
msgstr "Encountered an unexpected error while communicating with the remote server." "Encountered an unexpected error while communicating with the remote server."
msgstr ""
"Encountered an unexpected error while communicating with the remote server."
#: libs/localization.py:62 #: libs/localization.py:62
msgid "User already exists." msgid "User already exists."
@ -219,4 +225,4 @@ msgstr "Forgot your password? Please try again."
#: libs/localization.py:65 #: libs/localization.py:65
msgid "The session has expired." msgid "The session has expired."
msgstr "The session has expired." msgstr "The session has expired."

Binary file not shown.

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 0.0.1\n" "Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-07 17:23+0200\n" "POT-Creation-Date: 2022-04-07 17:23+0200\n"
"PO-Revision-Date: 2022-04-16 17:13+0200\n" "PO-Revision-Date: 2022-04-25 17:10+0200\n"
"Last-Translator: Aitzol Berasategi <aitzol@lainoa.eus>\n" "Last-Translator: Aitzol Berasategi <aitzol@lainoa.eus>\n"
"Language-Team: LANGUAGE <EU@eu.org>\n" "Language-Team: LANGUAGE <EU@eu.org>\n"
"Language: eu\n" "Language: eu\n"
@ -117,33 +117,37 @@ msgstr "Ongi etorri"
msgid "The session was closed." msgid "The session was closed."
msgstr "Saioa itxi da." msgstr "Saioa itxi da."
#: libs/localization.py:39 #: libs/localization.py:40
msgid "Username must be at least 3 characters long!" msgid "Username must be at least 3 characters long!"
msgstr "Erabiltzaile izenak gutxienez 3 karaktere izan behar ditu!" msgstr "Erabiltzaile izenak gutxienez 3 karaktere izan behar ditu!"
#: libs/localization.py:40 #: libs/localization.py:41
msgid "Please enter your password!" msgid "Not allowed characters for the username field."
msgstr "Sartu zure pasahitza, mesedez!" msgstr "Erabiltzaile-izen eremurako onartzen ez diren karaktereak."
#: libs/localization.py:42 #: libs/localization.py:42
msgid "The code is invalid or has expired." msgid "Not allowed characters for the firstname field."
msgstr "Kodea baliogabea da edo iraungi egin da." msgstr "Izen eremurako onartzen ez diren karaktereak."
#: libs/localization.py:43 #: libs/localization.py:43
msgid "A bit short, don't you think?!" msgid "Not allowed characters for the surname field."
msgstr "Labur-xamarra, ez duzu uste?!" msgstr "Abizen eremurako onartzen ez diren karaktereak."
#: libs/localization.py:44 #: libs/localization.py:44
msgid "Not allowed characters for the username field." msgid "The code is invalid or has expired."
msgstr "Erabiltzaile izenerako onartzen ez diren karaktereak." msgstr "Kodea baliogabea da edo iraungi egin da."
#: libs/localization.py:45 #: libs/localization.py:45
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Pasahitzak ez datoz bat!" msgstr "Pasahitzak ez datoz bat!"
#: libs/localization.py:46 #: libs/localization.py:46
msgid "Password must be at least 8 characters long!" msgid ""
msgstr "Pasahitzak gutxienez 8 karaktereko luzera izan behar du!" "The password must contain at least 8 characters, at least one number, "
"uppercase and lowercase letters and special characters."
msgstr ""
"Pasahitzak gutxienez 8 karaktere izan behar ditu, zenbakiren bat gutxienez, "
"hizki txiki zein larriak eta baita karaktere bereziak ere."
#: libs/localization.py:47 #: libs/localization.py:47
msgid "Congratulations, your account has been created!" msgid "Congratulations, your account has been created!"
@ -202,7 +206,8 @@ msgid "Unable to connect to the remote server."
msgstr "Ezinezkoa urruneko zerbitzara konektatzea." msgstr "Ezinezkoa urruneko zerbitzara konektatzea."
#: libs/localization.py:61 #: libs/localization.py:61
msgid "Encountered an unexpected error while communicating with the remote server." msgid ""
"Encountered an unexpected error while communicating with the remote server."
msgstr "Ezusteko errore bat gertatu da urruneko zerbitzariarekin komunikatzean." msgstr "Ezusteko errore bat gertatu da urruneko zerbitzariarekin komunikatzean."
#: libs/localization.py:62 #: libs/localization.py:62
@ -219,4 +224,4 @@ msgstr "Zure pasahitza ahaztu duzu? Saia zeitez berriz, mesedez."
#: libs/localization.py:65 #: libs/localization.py:65
msgid "The session has expired." msgid "The session has expired."
msgstr "Saioa iraungi egin da." msgstr "Saioa iraungi egin da."