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

Unable to generate slug with Chinese characters #2817

Closed
billmn opened this issue Nov 7, 2020 · 8 comments · Fixed by #9440
Closed

Unable to generate slug with Chinese characters #2817

billmn opened this issue Nov 7, 2020 · 8 comments · Fixed by #9440
Assignees
Labels

Comments

@billmn
Copy link
Contributor

billmn commented Nov 7, 2020

Bug Description

If you try to add Chinese characters in the Title field of an entry, Statamic doesn't generate the slug.

How to Reproduce

  1. In the Title field of an entry, insert: 你好,世界
  2. Press "Save"

Statamic version: 3.0.25

PHP version: 7.4.8

Install method (choose one):

  • Fresh install from statamic/statamic
@duncanmcclean
Copy link
Member

I think this issue is related to pid/speakingurl#61, an issue on speakingurl which is the package used by Statamic to create the slugs.

The update the maintainer suggests on there is for speakingurl to be swapped out in favour of Limax, another package.

@github-actions github-actions bot added stale and removed stale labels Jan 26, 2021
@statamic statamic deleted a comment from billmn Jul 6, 2021
@statamic statamic deleted a comment from github-actions bot Jul 6, 2021
@jackmcdade
Copy link
Member

Doesn't look like we can use Limax as it's intended to be used server side (Node) and has a huge package load size if attempting to run client-side. I couldn't get it to compile.

If we want to support Chinese and other multibyte characters, we'll need to find a compact library that can handle it.

@sheldonkotyk
Copy link

Any news on this. Also affects taxonomy terms.

@jackmcdade
Copy link
Member

What if we replaced https://github.com/pid/speakingurl with a javascript helper that hits a server-side endpoint so we can use the same logic on both client/server and not worry about js package loads. 🤔

@jasonvarga whatcha think?

@jesseleite
Copy link
Member

Different issue, but slug related... #8429 cc/ @martyf

Maybe we can tackle both at once, if we're taking a pass on slug generation?

@jasonvarga
Copy link
Member

jasonvarga commented Jan 31, 2024

What if we replaced pid/speakingurl with a javascript helper that hits a server-side endpoint so we can use the same logic on both client/server and not worry about js package loads.

That's what I was thinking too. At least for the more important language based ones like entry slugs. For stuff like field handles maybe it's less important.

@duncanmcclean
Copy link
Member

Different issue, but slug related... #8429 cc/ @martyf

Maybe we can tackle both at once, if we're taking a pass on slug generation?

It doesn't look like I linked it to the PR but that edge case has since been fixed in the current slug implementation (see #8923). It'll also be fixed when we merge #9440 since Laravel's Str::slug helper covers it too 💪

@duncanmcclean
Copy link
Member

duncanmcclean commented Apr 5, 2024

This has been fixed in Statamic 5, which we're hoping to release in the next few days/weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants