From b5769bb1f8d69e760d60f3b6537efcb657cd661e Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sat, 16 Nov 2019 14:12:15 +0000 Subject: [PATCH] Mark strings for translation in re2o --- re2o/acl.py | 8 ++++---- re2o/base.py | 4 ++-- re2o/templates/re2o/about.html | 10 +++++----- re2o/urls.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/re2o/acl.py b/re2o/acl.py index 5991df02..fd149a97 100644 --- a/re2o/acl.py +++ b/re2o/acl.py @@ -44,14 +44,14 @@ def acl_error_message(msg, permissions): if permissions is None: return msg groups = ", ".join([g.name for g in get_group_having_permission(*permissions)]) - message = msg or _("You don't have the right to edit" " this option.") + message = msg or _("You don't have the right to edit this option.") if groups: return ( message - + _(" You need to be a member of one of those" " groups : %s") % groups + + _("You need to be a member of one of these groups: %s.") % groups ) else: - return message + " No group have the %s permission(s) !" % " or ".join( + return message + _("No group has the %s permission(s)!") % " or ".join( [",".join(permissions[:-1]), permissions[-1]] if len(permissions) > 2 else permissions @@ -190,7 +190,7 @@ ModelC) for msg in error_messages: messages.error( request, - msg or _("You don't have the right to access" " this menu."), + msg or _("You don't have the right to access this menu."), ) if request.user.id is not None: return redirect( diff --git a/re2o/base.py b/re2o/base.py index e70c6612..6b12a4a6 100644 --- a/re2o/base.py +++ b/re2o/base.py @@ -96,9 +96,9 @@ def convert_datetime_format(format): def get_input_formats_help_text(input_formats): """Returns a help text about the possible input formats""" if len(input_formats) > 1: - help_text_template = "Format: {main} {more}" + help_text_template = _("Format: {main} {more}") else: - help_text_template = "Format: {main}" + help_text_template = _("Format: {main}") more_text_template = '' help_text = help_text_template.format( main=convert_datetime_format(input_formats[0]), diff --git a/re2o/templates/re2o/about.html b/re2o/templates/re2o/about.html index c2a226e1..03b8beca 100644 --- a/re2o/templates/re2o/about.html +++ b/re2o/templates/re2o/about.html @@ -38,16 +38,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{{ option.adresse1 | safe }}

{{ option.adresse2 | safe }}

-

SIRET : {{ option.siret | safe }}

+

{% trans "SIRET: " %}{{ option.siret | safe }}

{% trans "Publication manager" %}

{{ president }} - {% trans "President of " %} {{ option.pseudo }}

-

{% trans "General conditions of use" %}

+

{% trans "General Terms of Use" %}

{{ gtu }}

{% if option.description %} -

Extra informations

+

{% trans "Additional information" %}

{{ option.description | safe }}

{% endif %} @@ -57,11 +57,11 @@ with this program; if not, write to the Free Software Foundation, Inc., Rezo Metz and a few members of other FedeRez associations around the summer 2016.
- It is intended to be a tool independant from any network infrastructure + It is intended to be a tool independent from any network infrastructure so it can be setup in "a few steps". This tool is entirely free and available under a GNU Public License v2 (GPLv2) license on FedeRez gitlab.
- Re2o's mainteners are volunteers mainly from French schools.
+ Re2o's maintainers are volunteers mainly from French schools.
If you want to get involved in the development process, we will be glad to welcome you so do not hesitate to contact us and come help us build the future of Re2o. diff --git a/re2o/urls.py b/re2o/urls.py index a589d63c..146fc3b9 100644 --- a/re2o/urls.py +++ b/re2o/urls.py @@ -46,7 +46,7 @@ from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.contrib import admin -from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from django.views.generic import RedirectView from .settings_local import OPTIONNAL_APPS_RE2O