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

Fix for slugs with international chars #1921 #1922

Open
wants to merge 4 commits into
base: stable/2.8.x
Choose a base branch
from

Conversation

miceno
Copy link

@miceno miceno commented Feb 7, 2025

This PR solves issue #1921, by allowing a new configuration setting to use a different strategy to generate slugs, more suitable for international users.

It adds a new option on Global settings > Permalink, that allows replacing accented chars like á, é with ASCII chars a, e:

image

It uses the intl PHP module, and thus the PR includes some changes on building docker images.

The code autodetects the presence of the intl PHP module and for those setups that will not include it, the new option will not show.

Transliteration is done using the intl function transliterator_transliterate, that allows providing a mapping for the transliteration. The mapping is provided in a configuration setting with a default value.

The PR is against stable/2.8.x branch to allow other AtoM users to have it available as soon as it is merged.

@miceno miceno force-pushed the dev/issue-1921-intl-slugs branch from 4df5d69 to 7823df0 Compare February 9, 2025 10:47
@anvit
Copy link
Contributor

anvit commented Feb 10, 2025

Hi @miceno ! Thanks so much for reporting this issue and for submitting a PR. We're close to finalizing the 2.9 release so this change won't make it in the current release, but we'll be happy to review and accept this for the next release!

@anvit
Copy link
Contributor

anvit commented Feb 10, 2025

@miceno I did notice a couple small issues at a quick glance. I noticed that this branch is based off of the stable/2.8.x branch. Would you be able to rebase your changes to the qa/2.x branch, and update the PR to merge to that branch instead? That's the development branch with most up to date code and the stable/2.8.x is the release branch.

The other thing I noticed is that the tests were failing and were complaining about docker-compose not being found. This is likely due to the changes to the Dockerfile. Could you update that so that the intl dependencies are installed directly. My guess is that installing php-intl or the appropriate equivalent package instead of using docker-php-ext-install should resolve this.

@miceno
Copy link
Author

miceno commented Feb 13, 2025

I will have a look at it later, the change you proposed is not trivial for me, I don't know all the details about the docker configuration.

It is on the stable/2.8.x branch since I will appreciate it will show on the next release, and I thought next release was 2.8.3, not 2.9. I will try to change the base for the PR once I have moved forward with the docker changes.

@miceno miceno closed this Feb 17, 2025
@miceno miceno reopened this Feb 17, 2025
@anvit anvit linked an issue Feb 18, 2025 that may be closed by this pull request
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.

Problem: slugs with non-ascii chars are ill-formed
2 participants