[FIX] website_event: make Attendee # translatable

On the website,
when registering for an event with ticket,
the placeholder `Attendee #` could not be translated,
as `t-att` attributes are not translated.

An alternative is to put the string to translate
in a `t-set` node, which can be translated, and
to use the variable assigned in this `t-set`
in the `t-att` attribute.

opw-678758
This commit is contained in:
Denis Ledoux
2016-06-30 13:01:27 +02:00
parent a4e4881f4c
commit 7c9ab02c53
2 changed files with 7 additions and 1 deletions
@@ -117,6 +117,11 @@ msgstr ""
msgid "All Events"
msgstr ""
#. module: website_event
#: model:ir.ui.view,arch_db:website_event.registration_attendee_details
msgid "Attendee #%s"
msgstr ""
#. module: website_event
#: model:ir.ui.view,arch_db:website_event.registration_attendee_details
msgid "Cancel Registration"
+2 -1
View File
@@ -465,7 +465,8 @@
<t t-foreach="range(1, ticket['quantity'] + 1)" t-as="att_counter" name="attendee_loop">
<t t-set="counter" t-value="counter + 1"/>
<div class="row mb4">
<div class="col-md-4"><input class='form-control' type='text' t-attf-name="#{counter}-name" required="This field is required" t-att-placeholder="'Attendee #%s' %counter"/></div>
<t t-set="attendee_placeholder">Attendee #%s</t>
<div class="col-md-4"><input class='form-control' type='text' t-attf-name="#{counter}-name" required="This field is required" t-att-placeholder="attendee_placeholder %counter"/></div>
<div class="col-md-5"><input class='form-control' type='email' t-attf-name="#{counter}-email" required="This field is required"/></div>
<div class="col-md-3"><input class='form-control' type='tel' t-attf-name="#{counter}-phone"/></div>
<input class='hidden' type='text' t-attf-name="#{counter}-ticket_id" t-attf-value="#{ticket['id']}"/>