This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// It converts all lowercase or uppercase Turkish characters to English one on given text. | |
String.prototype.turkishToEnglish = function () { | |
return this | |
.replace(/Ğ/g, "G") | |
.replace(/ğ/g, "g") | |
.replace(/Ü/g, "U") | |
.replace(/ü/g, "u") | |
.replace(/Ş/g, "S") | |
.replace(/ş/g, "s") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.turkishtoEnglish = function () { | |
return this.replace('Ğ','g') | |
.replace('Ü','u') | |
.replace('Ş','s') | |
.replace('I','i') | |
.replace('İ','i') | |
.replace('Ö','o') | |
.replace('Ç','c') | |
.replace('ğ','g') | |
.replace('ü','u') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Metni url'de kullanılabilir hale çevirir. Boşluklar tireye çevrilir, | |
* alfanumerik olmayan katakterler silinir. | |
* | |
* Transform text into a URL path slug(with Turkish support). | |
* Spaces turned into dashes, remove non alnum | |
* | |
* @param string text | |
*/ | |
slugify = function(text) { |