-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[String] Slugger with Emoji throws IntlException for not supported locale #48364
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
Comments
Indeed, this is not really DX friendly! @nicolas-grekas any recommendation here? |
I suppose this is the way? Alternatively, we might want to use a fallback locale? Another option would be to remove the emojis from the slug. I know @fancyweb is considering this. But maybe that'd be solved by the fallback-locale option, by specifying a special |
Let's make |
I think we expect a locale with |
This PR was merged into the 6.2 branch. Discussion ---------- [String] Fix AsciiSlugger with emojis | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #48364 | License | MIT | Doc PR | - First fix: let's fall back to parent locales if the emoji map does not exist for the full locale? (like we do for symbols map) Second fix: let's just ignore the emoji transliterator for totally unsupported locales, the behavior of the slugger will just strip the emojis like it already does. Commits ------- 5f320e5 [String] Fix AsciiSlugger with emojis
I think we will need todo also the Mostly we have urls like PS: Thx for the quick fix 👍 |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
6.2.0
Description
In @sulu we try to add the Slugger with Emoji support. Currently the Slugger will hardly fail when the locale is not found with
IntlException
: https://github.com/sulu/sulu/actions/runs/3554459366/jobs/5970575754#step:10:578How to reproduce
Possible Solution
Catch exception in fallback to normal slug for not supported locale.
Additional Context
We currently don't know which locales are supported by
withEmoji
and which ones not. Which ends up in strange code if we need to handle that ourselves:/cc @lyrixx What do you think?
The text was updated successfully, but these errors were encountered: