Hi have wrote tablesorter plugin to sort Polish chars but plugin sorts just one way http://jsfiddle.net/Gk43v/ here is the example and plugin code
$.tablesorter.addParser({
id: 'polish-chars' ,
type: 'text',
is: function(s)
{
return false;
},
format: function(s)
{
return
s.replace('\u0105'/g, 'a')
.replace('\u0104'/g, 'A')
.replace('\u0118'/g, 'E')
.replace('\u0119'/g, 'e')
.replace('\u0107'/g, 'c')
.replace('\u0106'/g, 'C')
.replace('\u0143'/g, 'N')
.replace('\u0144'/g, 'n')
.replace('Ó'/g, 'O')
.replace('ó'/g, 'o')
.replace('\u0141'/g, 'L')
.replace('\u0142'/g, 'l')
.replace('\u015a'/g, 'S')
.replace('\u015b'/g, 's')
.replace('\u0179'/g, 'Z')
.replace('\u017a'/g, 'z')
.replace('\u017b'/g, 'Z')
.replace('\u017c'/g, 'z')
}
});
Edit:
When using this plugin with tablesorter it didn't show an error /g
, so it should look like
$.tablesorter.addParser({
id: 'polish-chars',
type: 'text',
is: function(s)
{
return false;
},
format: function(s)
{
return s.replace('ą', 'a')
.replace('Ą', 'A')
.replace('Ę', 'E')
.replace('ę', 'e')
.replace('ć', 'c')
.replace('Ć', 'C')
.replace('Ń', 'N')
.replace('ń', 'n')
.replace('Ó', 'O')
.replace('ó', 'o')
.replace('Ł', 'L')
.replace('ł', 'l')
.replace('Ś', 'S')
.replace('ś', 's')
.replace('Ź', 'Z')
.replace('ź', 'z')
.replace('Ż', 'Z')
.replace('ż', 'z');
}
});
and work just like I wanted to work.