From a26878273a899d10a5a574e73564c538c4585cce Mon Sep 17 00:00:00 2001 From: Yuri Salimovskiy Date: Sun, 5 Jan 2025 11:13:04 +0200 Subject: [PATCH] Added `lang` parameter for date variables in templates --- docs/templates/date-variable-formatting.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/templates/date-variable-formatting.md b/docs/templates/date-variable-formatting.md index 9f1308a1d..0c8bd58d7 100755 --- a/docs/templates/date-variable-formatting.md +++ b/docs/templates/date-variable-formatting.md @@ -43,6 +43,14 @@ The `timezone=` parameter will convert a date to the specified timezone: This will override the timezone specified in the [localization settings](control-panel/settings/general.md) in the control panel, and the member's localization settings. PHP.net has a [list of supported timezones](https://php.net/manual/en/timezones.php). +### Translating Dates + +By default, the dates are shown according to user preferred language or the system language. You can override this by using the `lang=` parameter: + + lang="french" + +Please note that the [language file](localization/languages.md) must be present in the `system/user/language/` directory. If the language file is not found, the date will be displayed in the default language. + ## Date Formatting Codes These are all the available formatting codes. If you are familiar with PHP, then these will look [remarkably similar](https://php.net/manual/en/function.date.php#refsect1-function.date-parameters):