Skip to content

Commit

Permalink
Data macros: support translation IDs in data keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Nikolaev committed Feb 16, 2021
1 parent 4ff91d8 commit 00c750e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Resources/views/macros.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
{% if name %}
<span class="details-list__property-name"
style="font-family: Arial, sans-serif; font-size: 15px; line-height: 23px; color: #7e7e7e;">
{% if value is iterable %}
{% if value is iterable and '.' not in title %}
{{ (title ~ '.title')|trans }}
{% else %}
{{ title|trans }}
Expand All @@ -75,7 +75,7 @@
{% else %}
<ul>
{% for item_name, item_value in value %}
<li>{{ that.div_property(item_name, title ~ '.item.' ~ item_name, item_value, trans_domain) }}</li>
<li>{{ that.div_property(item_name, '.' in item_name ? item_name : (title ~ '.item.' ~ item_name), item_value, trans_domain) }}</li>
{% endfor %}
</ul>
{% endif %}
Expand Down Expand Up @@ -118,7 +118,7 @@

{%- if name -%}

{%- if value is iterable -%}
{%- if value is iterable and '.' not in title -%}
{{- (title ~ '.title')|trans -}}
{%- else -%}
{{- title|trans -}}
Expand Down Expand Up @@ -148,7 +148,7 @@

{%- for item_name, item_value in value -%}

{{- that.plain_property(item_name, title ~ '.item.' ~ item_name, item_value, trans_domain) -}}
{{- that.plain_property(item_name, '.' in item_name ? item_name : (title ~ '.item.' ~ item_name), item_value, trans_domain) -}}

{%- if not loop.last -%}
{{- ', ' -}}
Expand Down Expand Up @@ -182,7 +182,7 @@
<tr>
{% if name %}
<th>
{% if value is iterable %}
{% if value is iterable and '.' not in title %}
{{ (title ~ '.title')|trans }}
{% else %}
{{ title|trans }}
Expand All @@ -201,7 +201,7 @@
{% endfor %}
{% else %}
{% for item_name, item_value in value %}
{{ that.table_property(item_name, title ~ '.item.' ~ item_name, item_value, trans_domain) }}
{{ that.table_property(item_name, '.' in item_name ? item_name : (title ~ '.item.' ~ item_name), item_value, trans_domain) }}
{% endfor %}
{% endif %}
</table>
Expand Down

0 comments on commit 00c750e

Please sign in to comment.