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

let StringHelper::toAscii use language detection #12606

Closed
wants to merge 1 commit into from

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Feb 1, 2023

Description

Field layout tabs don’t show when the tab name is in a language that doesn’t easily convert to ASCII. This affects languages like Mandarin, Hebrew, Korean, Japanese and potentially others.

This PR adds language detection via patrickschur/language-detection to the StringHelper::toAscii (only) if the current approach returns an empty string.

Related issues

#12602

@i-just i-just marked this pull request as ready for review February 2, 2023 14:03
@i-just i-just requested a review from a team as a code owner February 2, 2023 14:03
@brandonkelly
Copy link
Member

Pushed up a simpler fix – just switched to running the tab name through md5(), which will produce a consistent, ID-friendly result regardless of whether the tab name consists of ASCII-friendly characters.

@brandonkelly brandonkelly deleted the bugfix/12602-cp-tabs-missing-in-chinese branch February 3, 2023 12:07
@i-just
Copy link
Contributor Author

i-just commented Feb 3, 2023

Cool! I got hung up on keeping the anchor links human-friendly.

@brandonkelly
Copy link
Member

Ah shoot, I didn’t think about that 🤦🏻

Just reverted that back a bit, so md5() is only used as a fallback if toAscii() gives us an empty string. (db1ec08)

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

Successfully merging this pull request may close these issues.

2 participants