-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Convert locale to use - instead of _ from symfony #452
Conversation
Hi, @toooni thanks for the contribution.
I wonder if the replace couldnt be consider as a BC break if someone use the option value for something else... |
@VincentLanglet I had considered changing the locale in js but I think it's better if we do this in PHP and JS always gets locales which it supports.
This will reduce the possibility of a BC break and JS will always get a valid js locale. Theoretically, a BC break can happen when someone uses this var inside a twig template. But it's very unlikely since this change is pretty new and country specific locales in the current code do not work. |
I would say it is fine doing this change on the php side (it would probably do it on the js side since we already do other checks for the locale on the stimulus controller already). Also do remember that currently there is only one supported locale with country part on the js #allowedLocales (you might want to update that , and the js library if there are more locales now) |
If I understand correctly, you approve this PR ? :) |
Hi, we are facing the same issue after upgrading Passing My 2 cents, I find this solution #452 (comment) really fine, as we want to inject a JS valid locale without touching the locale PHP-side. |
Hi @Kocal does this PR would be ok for you as if too ? |
Hey @VincentLanglet, I think yes, we used But it's possible that is does not work if we manually override the option. |
Thanks for merging :) |
I'll release it with #455 |
Yes, Sorry for not giving explicit approval 🙏 |
Subject
Symfony does use country specific locales like
de_CH
. Js on the other hand usesde-CH
. This results in a js issue, sincedatepicker_controller.js
only splits by-
.I am targeting this branch, because the change fixes a bug and keeps BC.
Changelog