From c531f8cbfcd15cd99fd920d83788fdc0dc646739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yngve=20H=C3=B8iseth?= Date: Sun, 31 Jan 2021 21:05:17 +0100 Subject: [PATCH] Document how to get translation for active language (#1329) This was not obvious for me, so I assume some others might miss it. --- docs/content/documentation/templates/overview.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/content/documentation/templates/overview.md b/docs/content/documentation/templates/overview.md index 24fc0b5f..a42b0cac 100644 --- a/docs/content/documentation/templates/overview.md +++ b/docs/content/documentation/templates/overview.md @@ -331,11 +331,12 @@ The format is also taken into account when caching, so a request will be sent tw different formats. ### `trans` -Gets the translation of the given `key`, for the `default_language` or the `lang`uage given +Gets the translation of the given `key`, for the `default_language`, the `lang`uage given or the active language: ```jinja2 {{/* trans(key="title") */}} {{/* trans(key="title", lang="fr") */}} +{{/* trans(key="title", lang=lang) */}} ``` ### `resize_image`