Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

pretty URLs with Titles with special chars (slovak, czech, german...)


Reply

1174 Views

Avatar
pali

19 June 2009 at 9:14pm Community Member, 33 Posts

update sapphire/javascript/UpdateURL.js like this:

Add function

function deLocalize( inStr ) {

var outStr = inStr;
outStr = outStr.replace(/[áÁ]/g, 'a');
outStr = outStr.replace(/[éÉ]/g, 'e');
outStr = outStr.replace(/[íÍ]/g, 'i');
outStr = outStr.replace(/[ýÝ]/g, 'y');
outStr = outStr.replace(/[óÓ]/g, 'o');
outStr = outStr.replace(/[úÚ]/g, 'u');
outStr = outStr.replace(/[ôô]/g, 'o');
outStr = outStr.replace(/[ää]/g, 'a');
outStr = outStr.replace(/[ůů]/g, 'u');
outStr = outStr.replace(/[ěĚ]/g, 'e');
outStr = outStr.replace(/[Å¡Å ]/g, 's');
outStr = outStr.replace(/[čČ]/g, 'c');
outStr = outStr.replace(/[řŘ]/g, 'r');
outStr = outStr.replace(/[ťŤ]/g, 't');
outStr = outStr.replace(/[žŽ]/g, 'z');
outStr = outStr.replace(/[ľĽ]/g, 'l');
outStr = outStr.replace(/[ĺĹ]/g, 'l');
outStr = outStr.replace(/[ďĎ]/g, 'd');
outStr = outStr.replace(/[ňŇ]/g, 'n');
return outStr;
}

and replace

var newSuggestion = urlSegmentField.suggestNewValue( this.value.toLowerCase() );

with

var newSuggestion = urlSegmentField.suggestNewValue( deLocalize(this.value.toLowerCase()) );

Above chars are special for slovak or czech languages...

Enjoy

Pali