mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
♻️ refactor(translation): introduce translation macro (#129)
This commit is contained in:
parent
3344f80539
commit
78f97e17b4
18 changed files with 74 additions and 103 deletions
|
@ -1,11 +1,7 @@
|
|||
{% macro format_date(date, short) %}
|
||||
|
||||
{# Set locale #}
|
||||
{%- if lang != config.default_language %}
|
||||
{% set date_locale = trans(key="date_locale" | safe, lang=lang) %}
|
||||
{% else %}
|
||||
{% set date_locale = "en_GB" %}
|
||||
{% endif %}
|
||||
{% set date_locale = macros_translate::translate(key="date_locale", default="en_GB") %}
|
||||
|
||||
{% if config.extra.short_date_format and short %}
|
||||
{{ date | date(format=config.extra.short_date_format, locale=date_locale) }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue