4572 Posts in 1316 Topics by 981 members
Customising the CMS
SilverStripe Forums » Customising the CMS » pretty URLs with Titles with special chars (slovak, czech, german...)
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 900 Views |
-
pretty URLs with Titles with special chars (slovak, czech, german...)

19 June 2009 at 9:14pm
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
| 900 Views | ||
|
Page:
1
|
Go to Top |

