Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Better character replacement for URLSegment #1002

SewerHrehorowicz opened this Issue · 4 comments

4 participants


Diactric signs, such as ęółąśłżźć are deleted, and they should be replaced by euoslzzc. I don't know how it looks in other languages, but it works like that in Polish.

@tractorcow tractorcow added this to the 3.2 alpha 1 milestone

This sounds like a good idea.

Here's an example of a replacement chart that we could consider as an option.


If you have iconv installed, you can use:

  use_iconv: true

Hi, now for polish signs I use this code:

//Znaki PL w URLSegment - dodajemy w Class w Page.php
public function generateURLSegment($title){
        $arg1 = array('ą', 'Ą', 'ć', 'Ć', 'ę', 'Ę', 'ł', 'Ł', 'ń', 'Ń', 'ó', 'Ó', 'ś', 'Ś', 'ź', 'Ź', 'ż', 'Ż' );
        $arg2 = array('a', 'a', 'c', 'c', 'e', 'e', 'l', 'l', 'n', 'n', 'o', 'o', 's', 's', 'z', 'z', 'z', 'z' );
        $title = str_replace ( $arg1, $arg2, $title );
        $filter = URLSegmentFilter::create();
        $t = $filter->filter($title);

        // Fallback to generic page name if path is empty (= no valid, convertable characters)
        if(!$t || $t == '-' || $t == '-1') $t = "page-$this->ID";

        // Hook for extensions
        $this->extend('updateURLSegment', $t, $title);

        return $t;

And yes, I think too that this good idea

Sorry for my weak English

@tractorcow tractorcow modified the milestone: 4.0, 3.2 alpha 1

Changing to 4.0 since there's no fix in time for 3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.