Commit aa02016c authored by Maël Kervella's avatar Maël Kervella

Translation: Setup re2o to use locale and add French

parent a7d47b97
......@@ -80,11 +80,11 @@ class NewFactureForm(FormRevMixin, ModelForm):
banque = cleaned_data.get('banque')
if not paiement:
raise forms.ValidationError(
_("A payment method must be specified")
_("A payment method must be specified.")
)
elif paiement.type_paiement == 'check' and not (cheque and banque):
raise forms.ValidationError(
_("A cheque number and a bank must be specified")
_("A cheque number and a bank must be specified.")
)
return cleaned_data
......@@ -225,7 +225,7 @@ class PaiementForm(FormRevMixin, ModelForm):
self.fields['moyen'].label = _("Payment method name")
self.fields['type_paiement'].label = _("Payment type")
self.fields['type_paiement'].help_text = \
_("The payement type is use for specific behaviour.\
_("The payement type is used for specific behaviour.\
The \"cheque\" type means a cheque number and a bank name\
may be added when using this payment method.")
......@@ -349,7 +349,7 @@ class RechargeForm(FormRevMixin, Form):
if value < OptionalUser.get_cached_value('min_online_payment'):
raise forms.ValidationError(
_("Requested amount is too small. Minimum amount possible : \
%(min_online_amount)s €") % {
%(min_online_amount)s €.") % {
min_online_amount: OptionalUser.get_cached_value(
'min_online_payment'
)
......@@ -358,7 +358,7 @@ class RechargeForm(FormRevMixin, Form):
if value + self.user.solde > OptionalUser.get_cached_value('max_solde'):
raise forms.ValidationError(
_("Requested amount is too high. Your balance can't exceed \
%(max_online_balance)s €") % {
%(max_online_balance)s €.") % {
max_online_balance: OptionalUser.get_cached_value(
'max_solde'
)
......
This diff is collapsed.
......@@ -105,7 +105,7 @@ class Facture(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
abstract = False
permissions = (
# TODO : change facture to invoice
('change_facture_control', _("Can change the controlled state")),
('change_facture_control', _("Can change the \"controlled\" state")),
# TODO : seems more likely to be call create_facture_pdf or create_invoice_pdf
('change_facture_pdf', _("Can create a custom PDF invoice")),
('view_facture', _("Can see an invoice's details")),
......@@ -185,7 +185,7 @@ class Facture(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
@staticmethod
def can_change_control(user_request, *args, **kwargs):
return user_request.has_perm('cotisations.change_facture_control'), _("You don't have the right to edit the controlled state.")
return user_request.has_perm('cotisations.change_facture_control'), _("You don't have the right to edit the \"controlled\" state.")
@staticmethod
def can_change_pdf(user_request, *args, **kwargs):
......@@ -338,7 +338,7 @@ class Vente(RevMixin, AclMixin, models.Model):
def can_edit(self, user_request, *args, **kwargs):
if not user_request.has_perm('cotisations.change_vente'):
return False, _("You don't have the rights to edit the purchases.")
return False, _("You don't have the right to edit the purchases.")
elif not user_request.has_perm('cotisations.change_all_facture') and not self.facture.user.can_edit(user_request, *args, **kwargs)[0]:
return False, _("You don't have the right to edit this user's purchases.")
elif not user_request.has_perm('cotisations.change_all_vente') and\
......@@ -541,7 +541,7 @@ class Cotisation(RevMixin, AclMixin, models.Model):
COTISATION_TYPE = (
('Connexion', _("Connexion")),
('Adhesion', _("Adhesion")),
('Adhesion', _("Membership")),
('All', _("Both of them")),
)
......@@ -591,7 +591,7 @@ class Cotisation(RevMixin, AclMixin, models.Model):
def can_view(self, user_request, *args, **kwargs):
if not user_request.has_perm('cotisations.view_cotisation') and\
self.vente.facture.user != user_request:
return False, _("You don't have the right to display someone else's cotisation history.")
return False, _("You don't have the right to see someone else's cotisation history.")
else:
return True, None
......
......@@ -296,7 +296,7 @@ def del_facture(request, facture, factureid):
if request.method == "POST":
messages.success(
request,
_("The invoice has been successfully deleted")
_("The invoice has been successfully deleted.")
)
return redirect(reverse('cotisations:index'))
return form({
......@@ -327,7 +327,7 @@ def credit_solde(request, user, userid):
new_vente.save()
messages.success(
request,
_("Banlance successfully updated.")
_("Balance successfully updated.")
)
return redirect(reverse('cotisations:index'))
return form({'factureform': facture, 'action_name' : 'Créditer'}, 'cotisations/facture.html', request)
......@@ -442,14 +442,14 @@ def del_paiement(request, instances):
messages.success(
request,
_("The payment method %(method_name)s has been \
successfully deleted") % {
successfully deleted.") % {
method_name: paiement_del
}
)
except ProtectedError:
messages.error(
request,
_("The payment method %(method_name) can't be deleted \
_("The payment method %(method_name)s can't be deleted \
because there are invoices using it.") % {
method_name: paiement_del
}
......@@ -677,8 +677,8 @@ def new_facture_solde(request, userid):
for art_item in articles if art_item.cleaned_data):
messages.success(
request,
_("The balance of %(member_name)s has been successfully \
extended to %(end_date)s") % {
_("The cotisation of %(member_name)s has been successfully \
extended to %(end_date)s.") % {
member_name: user.pseudo,
end_date: user.end_adhesion()
}
......
......@@ -82,6 +82,7 @@ INSTALLED_APPS = (
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
......@@ -120,7 +121,7 @@ WSGI_APPLICATION = 're2o.wsgi.application'
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE = 'fr-fr'
LANGUAGE_CODE = 'en'
TIME_ZONE = 'Europe/Paris'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment