According to W3C[1] (and RFC1766) the valid format for language codes is
"primary-code"-"subcode", but Symfony expects underscores as separator,
resulting in broken translations.
This changes language codes specified in the correct format for HTML to
the Symfony format when reading the "lang" attribute.
Fixes#2378
[1] https://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1
This PR was merged into the 2.x branch.
Discussion
----------
[Translator] Revert #1965, which break cache warmup for Symfony applications
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Issues | Fix#2056 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- For new features, provide some code snippets to help understand usage.
- Features and deprecations must be submitted against branch main.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Hi everyone!
It looks like we were too fast on #1965, and our tests base didn't see the issue.
With 2.19.0, people started to have issues with the CacheWarmer from UX Translator, which was... simply never called, and so the folder `var/translations` was not generated anymore.
In private, we've decided to revert the feature to fix the issue, and to re-open the discussion if necessary.
Commits
-------
baf9f5e4 [Translator] Revert #1965, which break cache warmup for Symfony applications