Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix siteLanguage("locale") TypoScript condition example #1436

Closed
wants to merge 1 commit into from

Conversation

cundd
Copy link

@cundd cundd commented Nov 20, 2024

The current example for the siteLanguage condition does not seem to be working. If I understand the code correctly, the locale string will be normalized to use dashes (e.g. fr-CH) as separator instead of an underscore (fr_CH) (see Locale.php.

The output of "locale" in <f:debug>{siteLanguage}</f:debug> is also a bit misleading as it uses the posixFormatted version instead of the one used in the TypoScript condition.

Please check this proposed change carefully, as I may not understand the whole picture and/or some things depend on the actual hosting environment.

The current example for the `siteLanguage` condition does not seem to be working. If I understand the code correctly, the locale string will be normalized to use dashes (e.g. `fr-CH`) as separator instead of an underscore (`fr_CH`) (see [Locale.php](https://git.typo3.org/typo3/typo3/-/blob/22b303f63282e422533b37b09c624900c5995c70/typo3/sysext/core/Classes/Localization/Locale.php#L104).

The output of "locale" in `<f:debug>{siteLanguage}</f:debug>` is also a bit misleading as it uses the `posixFormatted` version instead of the one used in the TypoScript condition.

Please check this proposed change carefully, as I may not understand the whole picture and/or some things depend on the actual hosting environment.
@linawolf
Copy link
Member

Attention! A preport to main is probably needed

@cundd
Copy link
Author

cundd commented Nov 25, 2024

Should I close this PR and create on against main?

@linawolf
Copy link
Member

If it is not to much work that would be great. Our automatic backport workflow only works for PRs against main

@cundd cundd closed this by deleting the head repository Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants