Fixed symfony UX translations when using a locale with subregion (e.g. en_US)

Fixes issue described in #563
This commit is contained in:
Jan Böhmer 2024-06-22 19:57:30 +02:00
parent 445229976f
commit 701713e298

View file

@ -1,5 +1,7 @@
<!DOCTYPE html>
<html lang="{{ app.request.locale }}">
<html lang="{{ app.request.locale | replace({"_": "-"}) }}"
{# For the UX translator, just use the language part (before the _. should be 2 chars), otherwise it finds no translations #}
data-symfony-ux-translator-locale="{{ app.request.locale|u.truncate(2) }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">