The phpbb_seo class handles de-accentuation for most of the occidental characters, but you could need to handle more cases for your project.
Starting from v0.6.0, we introduced a simple way to set up custom replacements.
This is useful for special characters not properly handled by default, such as Russian ones (Г => G), or to implement custom replacements such as $ => dollar.
It works with any string, but you MUST perform the edits with an UTF-8 (without BOM) capable text editor.
This is still done in phpbb_seo/includes/setup_phpbb_seo.php, and still before :
- Code: Select all
// Let's make sure that settings are consistent
$this->check_config();
The principle is simple, you can set up your custom replacement by filling the phpbb_seo::url_replace array ($this->url_replace).
The pattern to use is :
- Code: Select all
$this->url_replace = array(
'character(s) to find' => 'replacement to apply',
);
EXAMPLE :
- Code: Select all
$this->url_replace = array(
// Purely cosmetic replace
'$' => 'dollar', '€' => 'euro',
'\'s' => 's', // it's => its / mary's => marys ...
// Language specific replace (German example)
'ß' => 'ss',
'Ä' => 'Ae', 'ä' => 'ae',
'Ö' => 'Oe', 'ö' => 'oe',
'Ü' => 'Ue', 'ü' => 'ue',
);
Just make sure that the characters you may add are not already handled properly but the default replacements before you add some more.
Please note that English characters are already properly handled.
You can use this thread to discuss about your case and to share the code for specific languages.

English |
French

