diff --git a/tickets/models.py b/tickets/models.py index 5bc37856..3308c6db 100644 --- a/tickets/models.py +++ b/tickets/models.py @@ -25,30 +25,30 @@ class Ticket(AclMixin, models.Model): null=True, ) title = models.CharField( - max_length=255, help_text=_("Title of the ticket"), blank=False, null=False + max_length=255, help_text=_("Title of the ticket."), blank=False, null=False ) description = models.TextField( max_length=3000, - help_text=_("Description of the ticket"), + help_text=_("Description of the ticket."), blank=False, null=False, ) date = models.DateTimeField(auto_now_add=True) email = models.EmailField( - help_text=_("An email address to get back to you"), max_length=100, null=True + help_text=_("An email address to get back to you."), max_length=100, null=True ) solved = models.BooleanField(default=False) class Meta: permissions = (("view_tickets", _("Can view a ticket object")),) - verbose_name = _("Ticket") - verbose_name_plural = _("Tickets") + verbose_name = _("ticket") + verbose_name_plural = _("tickets") def __str__(self): if self.user: - return "Ticket from {}. Date: {}".format(self.user.surname, self.date) + return _("Ticket from %(name)s. Date: %(date)s.").format(name=self.user.surname, date=self.date) else: - return "Anonymous Ticket. Date: {}".format(self.date) + return _("Anonymous ticket. Date: %s.") % (self.date) def publish_mail(self): site_url = GeneralOption.objects.first().main_site_url @@ -57,7 +57,7 @@ class Ticket(AclMixin, models.Model): lang = Preferences.objects.first().mail_language if lang == 0: - obj = "Nouvelle ouverture de ticket" + obj = "Nouveau ticket ouvert" template = loader.get_template("tickets/publication_mail_fr") else: obj = "New ticket opened" diff --git a/tickets/preferences/models.py b/tickets/preferences/models.py index 8add48bd..27922303 100644 --- a/tickets/preferences/models.py +++ b/tickets/preferences/models.py @@ -7,15 +7,15 @@ class Preferences(models.Model): publish_address = models.EmailField( help_text=_( - "Email address to publish the new tickets (leave empty for no publications)" + "Email address to publish the new tickets (leave empty for no publication)." ), max_length=1000, null=True, ) LANG_FR = 0 LANG_EN = 1 - LANGUES = ((0, _("Français")), (1, _("English"))) + LANGUES = ((0, _("French")), (1, _("English"))) mail_language = models.IntegerField(choices=LANGUES, default=LANG_FR) class Meta: - verbose_name = _("Ticket's settings") + verbose_name = _("tickets preferences") diff --git a/tickets/templates/tickets/aff_ticket.html b/tickets/templates/tickets/aff_ticket.html index c5605863..b66ad1c5 100644 --- a/tickets/templates/tickets/aff_ticket.html +++ b/tickets/templates/tickets/aff_ticket.html @@ -31,11 +31,11 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %} -

Ticket #{{ticket.id}} +

{% blocktrans with id=ticket.id %}Ticket #{{id}}{% endblocktrans %} {% if ticket.solved %} {% trans "Solved" %} {% else %} -{% trans "Not Solved" %} +{% trans "Not solved" %} {% endif %}

@@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ ticket.user.get_full_name }} {% else %} - {% trans "Anonymous User" %} + {% trans "Anonymous user" %} {% endif %} {{ ticket.date | naturalday}}. {% if not ticket.user %} @@ -57,7 +57,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "Title:" %} {{ticket.title}}

-

{% trans "Description" %} {{ ticket.description }}

+

{% trans "Description:" %} {{ ticket.description }}

@@ -65,9 +65,11 @@ with this program; if not, write to the Free Software Foundation, Inc., {% bootstrap_form changestatusform %} {% if not ticket.solved %} - {% bootstrap_button "Mark as Solved" button_type="submit" button_class='btn-info' %} + {% trans "Mark as solved" as tr_mark_solved %} + {% bootstrap_button tr_mark_solved button_type="submit" button_class='btn-info' %} {% else %} - {% bootstrap_button "Mark as not Solved" button_type="submit" button_class='btn-warning' %} + {% trans "Mark as not solved" as tr_mark_not_solved %} + {% bootstrap_button tr_mark_not_solved button_type="submit" button_class='btn-warning' %} {% endif %}
@@ -76,7 +78,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-

{% trans "Tous les tickets" %}

+

{% trans "All tickets" %}

{% endblock %} diff --git a/tickets/templates/tickets/aff_tickets.html b/tickets/templates/tickets/aff_tickets.html index 1f0c963e..218c6f0d 100644 --- a/tickets/templates/tickets/aff_tickets.html +++ b/tickets/templates/tickets/aff_tickets.html @@ -32,13 +32,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
- {{ nbr_tickets }} {% trans "Tickets" %} + {{ nbr_tickets }} {% blocktrans count nb=nbr_tickets %}Ticket{% plural %}Tickets{% endblocktrans %}
- {{ nbr_tickets_unsolved }}{% trans "Not Solved Tickets" %} + {{ nbr_tickets_unsolved }} {% blocktrans count nb=nbr_tickets_unsolved %}Ticket not solved{% plural %}Tickets not solved{% endblocktrans %}
- {% trans "Last Ticket:" %} {{ last_ticket_date }} + {% trans "Last ticket:" %} {{ last_ticket_date }}

@@ -52,10 +52,10 @@ with this program; if not, write to the Free Software Foundation, Inc., - User - Titre - Date - Résolu + {% trans "User" %} + {% trans "Title" %} + {% trans "Date" %} + {% trans "Solved" %} {% for ticket in tickets_list %} @@ -67,7 +67,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if ticket.user %} {{ ticket.user.get_short_name }} {% else %} - Anonyme + {% trans "Anonymous" %} {% endif %} {{ ticket.title }} {{ ticket.date }} diff --git a/tickets/templates/tickets/contact.html b/tickets/templates/tickets/contact.html index 475af26d..f6c9561b 100644 --- a/tickets/templates/tickets/contact.html +++ b/tickets/templates/tickets/contact.html @@ -1,13 +1,13 @@ {% load i18n %}
-

Tickets

+

{% trans "Tickets" %}

{% blocktrans %}If you are experiencing issues with the services offered by {{asso_name}}, you can open a ticket that will be taken care of. If you want to contact us on any other topic, please choose one address below.{% endblocktrans %}
- +
diff --git a/tickets/templates/tickets/form_preferences.html b/tickets/templates/tickets/form_preferences.html index d6521a8b..d5dd223b 100644 --- a/tickets/templates/tickets/form_preferences.html +++ b/tickets/templates/tickets/form_preferences.html @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Ticket" %}{% endblock %} {% block content %} -

{% trans "Tickets settings modification" %}

+

{% trans "Editing of tickets preferences" %}

{% for message in messages %}
@@ -43,6 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% csrf_token %} {% bootstrap_field preferencesform.publish_address %} {% bootstrap_field preferencesform.mail_language %} - {% bootstrap_button "Editer" button_type="submit" icon='ok' button_class='btn-success' %} + {% trans "Edit" as tr_edit %} + {% bootstrap_button tr_edit button_type="submit" icon='ok' button_class='btn-success' %} {% endblock %} diff --git a/tickets/templates/tickets/form_ticket.html b/tickets/templates/tickets/form_ticket.html index f4c90147..b05803bc 100644 --- a/tickets/templates/tickets/form_ticket.html +++ b/tickets/templates/tickets/form_ticket.html @@ -1,4 +1,4 @@ -{% extends 'machines/sidebar.html' %} +{% extends 'users/sidebar.html' %} {% comment %} Re2o est un logiciel d'administration développé initiallement au rezometz. Il se veut agnostique au réseau considéré, de manière à être installable en @@ -31,28 +31,29 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Ticket" %}{% endblock %} {% block content %} -

Ouverture d'un Ticket

+

{% trans "Ticket opening" %}

{% csrf_token %} {% if not user.is_authenticated %} -

{% trans "Vous n'êtes pas authentifié. Veuillez fournir une adresse mail afin que nous puissions vous recontacter." %}

+

{% trans "You are not authenticated. Please log in or provide an email address so we can get back to you." %}

{% bootstrap_field ticketform.email %} {% endif %} {% bootstrap_field ticketform.title %}
-

{% trans "Description de votre problème. Veuillez fournir le plus d'informations possible afin de faciliter la recherche de solution. Voici quelques informations dont nous pourions avoir besoin:" %}

+

{% trans "Description of your problem. Please give as much information as possible to help us searching for a solution. Here is some information we might need:" %}

  • -

    {% trans "Le type de votre problème (adhesion, connexion, paiement ou autre)." %}

    +

    {% trans "The type of your problem (membership, connection, payment etc.)." %}

  • -

    {% trans "Les conditions dans lesquelles vous rencontrez le problème (Wifi/filaire, sur tout les apareils ou sur un seul. Est-ce une nouvelle machine ?" %}

    +

    {% trans "The conditions in which you encounter the problem (Wi-Fi/wired connection, on every machines or only one, on a new machine etc.)." %}

  • -

    {% trans "Les endroits dans lequels le problème survient (chez vous, dans une partie commune, dans un batiment en particulier)." %}

    +

    {% trans "The locations where you encounter the problem (in your room, in a common space, in a specific building etc.)." %}

{% bootstrap_field ticketform.description %} - {% bootstrap_button "Ouvrir le Ticket" button_type="submit" icon='ok' button_class='btn-success' %} + {% trans "Open the ticket" as tr_open %} + {% bootstrap_button tr_open button_type="submit" icon='ok' button_class='btn-success' %}
{% endblock %} diff --git a/tickets/templates/tickets/index.html b/tickets/templates/tickets/index.html index ba5730e6..80b11351 100644 --- a/tickets/templates/tickets/index.html +++ b/tickets/templates/tickets/index.html @@ -29,6 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title%}{% trans "Tickets" %}{% endblock %} {% block content %} -

{% trans "Tickets" %}

+

{% trans "List of tickets" %}

{% include 'tickets/aff_tickets.html' with tickets_list=tickets_list %} {% endblock %} diff --git a/tickets/templates/tickets/navbar.html b/tickets/templates/tickets/navbar.html index 11473229..d344f822 100644 --- a/tickets/templates/tickets/navbar.html +++ b/tickets/templates/tickets/navbar.html @@ -1,2 +1,2 @@ {% load i18n %} -
  • {% trans "Tickets" %}
  • +
  • {% trans "Manage the tickets" %}
  • diff --git a/tickets/templates/tickets/navbar_logout.html b/tickets/templates/tickets/navbar_logout.html index 8a7114f3..7c4dcd20 100644 --- a/tickets/templates/tickets/navbar_logout.html +++ b/tickets/templates/tickets/navbar_logout.html @@ -1,6 +1,6 @@ {% load i18n %}
  • - {% trans "Ouvrir un ticket" %} + {% trans "Open a ticket" %}
  • diff --git a/tickets/templates/tickets/preferences.html b/tickets/templates/tickets/preferences.html index 60cbfac6..df51f3e1 100644 --- a/tickets/templates/tickets/preferences.html +++ b/tickets/templates/tickets/preferences.html @@ -18,11 +18,11 @@
    - + {% if preferences.publish_address %} {% else %} - + {% endif %} diff --git a/tickets/templates/tickets/profil.html b/tickets/templates/tickets/profil.html index 06b727a4..05d03ccf 100644 --- a/tickets/templates/tickets/profil.html +++ b/tickets/templates/tickets/profil.html @@ -3,13 +3,13 @@

    - {% trans " Tickets" %} + {% trans "Tickets" %}

    diff --git a/tickets/views.py b/tickets/views.py index 04ecee6d..d330719a 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -66,7 +66,7 @@ def new_ticket(request): messages.success( request, _( - "Your ticket has been succesfully open. We will take care of it as soon as possible." + "Your ticket has been succesfully opened. We will take care of it as soon as possible." ), ) return redirect( @@ -77,7 +77,7 @@ def new_ticket(request): messages.success( request, _( - "Your ticket has been succesfully open. We will take care of it as soon as possible." + "Your ticket has been succesfully opened. We will take care of it as soon as possible." ), ) return redirect(reverse("index")) @@ -85,7 +85,7 @@ def new_ticket(request): messages.error( request, _( - "You are not authenticated. Please login or provide an email address so we can get back to you." + "You are not authenticated. Please log in or provide an email address so we can get back to you." ), ) return form( @@ -149,10 +149,10 @@ def edit_preferences(request): if preferencesform.is_valid(): if preferencesform.changed_data: preferencesform.save() - messages.success(request, "Préférences des Tickets mises à jour") + messages.success(request, _("The tickets preferences were edited.")) return redirect(reverse("preferences:display-options")) else: - messages.error(request, "Formulaire Invalide") + messages.error(request, _("Invalid form.")) return form( {"preferencesform": preferencesform}, "tickets/form_preferences.html",

    {% trans "Publication email address"%}

    {% trans "Publication email address" %}

    {{ preferences.publish_address }}

    {% trans "Pas d'adresse, les tickets ne sont pas annoncés" %}

    {% trans "No email address, the tickets will not be published." %}