Transliteration on path fields

Created on 24 October 2023, 8 months ago

Problem/Motivation

Automatic translation includes the path field of nodes but transliteration is not run on the result. Thus, aliases containing spaces and special characters are created.

For example, on a German site about social benefits for families, the info page about "Elterngeld" got the custom alias "/elterngeld" (custom here means it is not automatically created by pathauto). When translating this to English, the url will be "/parental allowance". Translation is correct, but there is a space in the alias which should be a hyphen: "/parental-allowance".
For "Muttergeld", it's even a bit worse, the alias "/muttergeld" gets translated to "/mother's money", containing not only a space but also an apostroph.

The site in question is using DeepL translation service, but I guess that's not really relevant.

Steps to reproduce

Using a site with German as original language and English as secondary language and then applying the examples above, the behaviour can be seen. It's important to _not_ generate URL aliases automatically, as in that case the pathauto restriction kicks in and URL alias is excluded. Alias will be set after saving by pathauto depending on the defined pattern.

Proposed resolution

After translation is done on a path field, transliteration should be run and spaces be replaced by hyphens.

Disabling URL alias translation is not an option, as translated aliases should be allowed.
Excluding URL alias field from text extraction should also not be an option (is that possible with "path" being a base field? How would I apply thirdPartySettings?), as aliases actually shall be translated.

First question of course is, am I missing something? Maybe there is already an option or setting?

πŸ’¬ Support request
Status

Active

Version

1.15

Component

Source: Node

Created by

πŸ‡©πŸ‡ͺGermany broon Potsdam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024