1
我有翻譯字符串包含日期。使用功能在樹枝的翻譯
{% trans with {'%date%': lastAcceptedDate } from "translations" %}createdBefore%date%notAccepted{% endtrans %}
現在我想格式化日期。可能按日期功能。像下面的東西在PHP
__('createdBefore%date%notAccepted',
array(
'%date%' => (new DateTime($lastAcceptedDate))->format('d.m. Y')
)
);
這絕對不是工作或最佳的代碼。這只是我想要實現的另一種解釋形式。
我發現我可以用正常的字符串做它在樹枝像這樣
{{ lastAcceptedDate | date("d.m. Y") }}
,但我無法找到如何做到這一點的樹枝的翻譯標籤。