mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-25 06:44:47 +00:00
Add locale support for sort filter run prefix
This commit is contained in:
@@ -21,6 +21,7 @@ exports.sort = function(operationSubFunction,options) {
|
|||||||
sortKeys = [],
|
sortKeys = [],
|
||||||
indexes = new Array(inputTitles.length),
|
indexes = new Array(inputTitles.length),
|
||||||
compareFn;
|
compareFn;
|
||||||
|
const locale = $tw.utils.checkLanguageCode(suffixes[2] && suffixes[2][0] ? suffixes[2][0] : "") ? suffixes[2][0] : undefined;
|
||||||
results.each(function(title) {
|
results.each(function(title) {
|
||||||
var key = operationSubFunction(options.wiki.makeTiddlerIterator([title]),widget.makeFakeWidgetWithVariables({
|
var key = operationSubFunction(options.wiki.makeTiddlerIterator([title]),widget.makeFakeWidgetWithVariables({
|
||||||
"currentTiddler": "" + title,
|
"currentTiddler": "" + title,
|
||||||
@@ -34,7 +35,7 @@ exports.sort = function(operationSubFunction,options) {
|
|||||||
indexes[t] = t;
|
indexes[t] = t;
|
||||||
}
|
}
|
||||||
// Sort the indexes
|
// Sort the indexes
|
||||||
compareFn = $tw.utils.makeCompareFunction(sortType,{defaultType: "string", invert:invert, isCaseSensitive:isCaseSensitive});
|
compareFn = $tw.utils.makeCompareFunction(sortType,{defaultType: "string", invert:invert, isCaseSensitive:isCaseSensitive,locale:locale});
|
||||||
indexes = indexes.sort(function(a,b) {
|
indexes = indexes.sort(function(a,b) {
|
||||||
return compareFn(sortKeys[a],sortKeys[b]);
|
return compareFn(sortKeys[a],sortKeys[b]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user