@@ -54,14 +54,14 @@
{{ entity.id }} |
{{ entity.subject }} |
{{ entity.userCreatedObject }} |
- {{ macros.status_btn(entity.status, entity.statusString|trans, true) }} |
- {{ macros.priority_btn(entity.priority, entity.priorityString|trans, true) }} |
- {% if entity.lastMessage %}{{ entity.lastMessage|date('LABEL_DATE_TIME_FORMAT'|trans) }}{% endif %} |
- {% if entity.createdAt %}{{ entity.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans) }}{% endif %} |
+ {{ macros.status_btn(entity.status, entity.statusString|trans({}, translationDomain|default('messages')), true, translationDomain) }} |
+ {{ macros.priority_btn(entity.priority, entity.priorityString|trans({}, translationDomain|default('messages')), true, translationDomain) }} |
+ {% if entity.lastMessage %}{{ entity.lastMessage|date('LABEL_DATE_TIME_FORMAT'|trans({}, translationDomain|default('messages'))) }}{% endif %} |
+ {% if entity.createdAt %}{{ entity.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans({}, translationDomain|default('messages'))) }}{% endif %} |
{% else %}
- {{ 'MESSAGE_NO_TICKETS'|trans }}. |
+ {{ 'MESSAGE_NO_TICKETS'|trans({}, translationDomain|default('messages')) }}. |
{% endfor %}
diff --git a/Resources/views/Ticket/new.html.twig b/Resources/views/Ticket/new.html.twig
index 757595b5..f8601c82 100644
--- a/Resources/views/Ticket/new.html.twig
+++ b/Resources/views/Ticket/new.html.twig
@@ -1,7 +1,7 @@
{% extends '@HackzillaTicket/layout.html.twig' %}
{% block hackzilla_ticket_content -%}
-
{{ form_start(form, {'method': 'POST', 'action': path('hackzilla_ticket_create')}) }}
@@ -23,10 +23,10 @@
diff --git a/Resources/views/Ticket/show.html.twig b/Resources/views/Ticket/show.html.twig
index aa401ee5..639d2c0d 100644
--- a/Resources/views/Ticket/show.html.twig
+++ b/Resources/views/Ticket/show.html.twig
@@ -4,48 +4,48 @@
{% block hackzilla_ticket_content -%}
- {{ 'BUTTON_BACK_TO_LIST'|trans }}
+ {{ 'BUTTON_BACK_TO_LIST'|trans({}, translationDomain|default('messages')) }}
- {{ macros.status_btn(ticket.status, ticket.statusString|trans) }}
- {{ macros.priority_btn(ticket.priority, ticket.priorityString|trans) }}
+ {{ macros.status_btn(ticket.status, ticket.statusString|trans({}, translationDomain|default('messages')), false, translationDomain) }}
+ {{ macros.priority_btn(ticket.priority, ticket.priorityString|trans({}, translationDomain|default('messages')), false, translationDomain) }}
#{{ ticket.id }}
- {{ ticket.subject }}
- {{ 'LABEL_CREATED_BY'|trans }} {{ ticket.userCreatedObject }}
- , {{ ticket.createdAt|date('LABEL_DATE_FORMAT'|trans) }}
- {#
{{ 'LABEL_PRIORITY'|trans }} {{ ticket.priorityString|trans }} #}
+ {{ 'LABEL_CREATED_BY'|trans({}, translationDomain|default('messages')) }} {{ ticket.userCreatedObject }}
+ , {{ ticket.createdAt|date('LABEL_DATE_FORMAT'|trans({}, translationDomain|default('messages'))) }}
+ {#
{{ 'LABEL_PRIORITY'|trans({}, translationDomain|default('messages')) }} {{ ticket.priorityString|trans({}, translationDomain|default('messages')) }} #}
- {#
{{ 'HEADING_TICKET_THREAD'|trans }}
#}
+ {#
{{ 'HEADING_TICKET_THREAD'|trans({}, translationDomain|default('messages')) }}
#}
{% set previousStatus = null %}
{% set previousPriority = null %}
{% for message in ticket.messages %}
{% if previousStatus and previousStatus != message.status %}
- {{ macros.status_alert(message.status, message.statusString|trans) }}
+ {{ macros.status_alert(message.status, message.statusString|trans({}, translationDomain|default('messages')), translationDomain) }}
{% endif %}
{% if previousPriority and previousPriority != message.priority %}
- {{ macros.priority_alert(message.priority, message.priorityString|trans) }}
+ {{ macros.priority_alert(message.priority, message.priorityString|trans({}, translationDomain|default('messages')), translationDomain) }}
{% endif %}
{% if message.message|length > 0 %}
{{ message.userObject }}
- {#
{{ 'LABEL_PRIORITY'|trans }} {{ message.priorityString|trans }} #}
- {#
{{ 'LABEL_STATUS'|trans }} {{ message.statusString|trans }} #}
+ {#
{{ 'LABEL_PRIORITY'|trans({}, translationDomain|default('messages')) }} {{ message.priorityString|trans({}, translationDomain|default('messages')) }} #}
+ {#
{{ 'LABEL_STATUS'|trans({}, translationDomain|default('messages')) }} {{ message.statusString|trans({}, translationDomain|default('messages')) }} #}
{% if message.userObject != ticket.userCreatedObject %}{{ 'LABEL_ADMIN'|trans }} {% endif %}
- {{ message.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans) }}
+ class="label label-danger">{{ 'LABEL_ADMIN'|trans({}, translationDomain|default('messages')) }} {% endif %}
+ {{ message.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans({}, translationDomain|default('messages'))) }}
@@ -71,7 +71,7 @@
{{ form_rest(form) }}
-
+
{{ form_end(form) }}
@@ -82,7 +82,7 @@
{{ form_widget(delete_form) }}
-
+
{{ form_end(delete_form) }}
{% endif %}
diff --git a/Tests/Functional/TestKernel.php b/Tests/Functional/TestKernel.php
index 7cb665f6..d14d293b 100644
--- a/Tests/Functional/TestKernel.php
+++ b/Tests/Functional/TestKernel.php
@@ -121,7 +121,8 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
// HackzillaBundle config
$c->loadFromExtension('hackzilla_ticket', [
- 'user_class' => User::class,
+ 'user_class' => User::class,
+ 'translation_domain' => 'HackzillaTicketBundle',
]);
if ($this->useVichUploaderBundle) {
diff --git a/UPGRADE-3.x.md b/UPGRADE-3.x.md
index 87814aa3..752ffc04 100644
--- a/UPGRADE-3.x.md
+++ b/UPGRADE-3.x.md
@@ -1,3 +1,21 @@
+UPGRADE FROM 3.3 to 3.4
+=======================
+
+## Translation domain
+
+ * Using "messages" translation domain is deprecated in favor of "HackzillaTicketBundle"
+ in order to allow projects consuming this bundle to override translations in
+ a proper way.
+ You should configure "hackzilla_ticket.translation_domain" with the value "HackzillaTicketBundle",
+ which will be the only allowed value in version 4.0.
+
+```yml
+# packages/hackzilla_ticket.yaml
+
+hackzilla_ticket:
+ translation_domain: HackzillaTicketBundle
+```
+
UPGRADE FROM 3.2 to 3.3
=======================