Twig filters does not return translated format string/pattern when passing a langcode as parameter

Created on 16 July 2025, about 1 month ago

Problem/Motivation

The intl_format_date_pattern() Twig extension does not return the translated date pattern when a langcode parameter is provided.

For example, assume you have a format key custom_short_month with the following translations:

  • English (default): MMM d, YYYY
  • French: d MMM YYYY

Calling intl_format_date_pattern('custom_short_month', 'fr') is expected to return the French version of the pattern, but instead it returns the default English version (MMM d, YYYY), ignoring the provided langcode.

This behavior makes it impossible to properly localize date formatting in Twig templates.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇧🇷Brazil andre.bonon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024