We have make languages on our site (English, French, Spanish, Arabic, Chinese, Russian to name a few) and while transliteration makes sense for some (like french and spanish), for languages like chinese and arabic it's a disaster.

I think it would be beneficial to have transliteration enabled for some of our languages, and disabled for others.

Thanks

Issue fork pathauto-2972720

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

luca_loguercio created an issue. See original summary.

damienmckenna’s picture

Component: Code » I18n stuff
mastap’s picture

Hi luca_loguercio
Did you find a solution to this?
We need to make URLS in Chinese characters for certain languages on our portal.

chrisss’s picture

I'd also be very interested in having this feature implemented on our site. We have the same problem - running a site in English, French, Spanish and Arabic. We need transliteration for French and Spanish but not Arabic.

igoragatti made their first commit to this issue’s fork.

igoragatti’s picture

I've created this feature changing the single checkbox to use one checkbox per language.

There might still be a need for an update hook to update the config. Please test and let me know.

igoragatti’s picture

Status: Active » Needs review
igoragatti’s picture

Status: Needs review » Needs work

Needs to adjust the tests

rafael maito changed the visibility of the branch 8.x-1.x to hidden.

rafael maito changed the visibility of the branch 8.x-1.x to active.

mably made their first commit to this issue’s fork.

mably changed the visibility of the branch 8.x-1.x to hidden.

mably’s picture

Looks like we are missing some update hook to upgrade all existing patterns to the new transliteration configuration format.

Some tests are failing too.

Wondering if the UX couldn't be improved here. For example, if you add language to your site, you'll have to update all your patterns transliteration configuration to check (or not) that new language.

mably’s picture

Solution implemented in MR 173:

New configuration option

mably’s picture

Status: Needs work » Needs review

Here's a summary of what was done:

Schema (config/schema/pathauto.schema.yml): Reverted transliterate from sequence back to boolean.

AliasCleaner (src/AliasCleaner.php): Replaced in_array() with a new shouldTransliterate() method that checks for per-language config overrides via
ConfigurableLanguageManagerInterface::getLanguageConfigOverride(), falling back to the global boolean. Gracefully handles non-configurable language managers (e.g. in kernel tests).

Settings form (src/Form/PathautoSettingsForm.php):

  • Global transliterate is now a simple checkbox (boolean)
  • Per-language overrides appear in a collapsible details fieldset (only when >1 language exists)
  • Submit handler saves/clears language.config.{langcode}.pathauto.settings overrides as needed

No update hook needed — existing sites already have transliterate: TRUE (boolean) in their config.

mably’s picture

Assigned: Unassigned » berdir