mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-02-02 02:36:46 +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 = [],
|
||||
indexes = new Array(inputTitles.length),
|
||||
compareFn;
|
||||
const locale = $tw.utils.checkLanguageCode(suffixes[2] && suffixes[2][0] ? suffixes[2][0] : "") ? suffixes[2][0] : undefined;
|
||||
results.each(function(title) {
|
||||
var key = operationSubFunction(options.wiki.makeTiddlerIterator([title]),widget.makeFakeWidgetWithVariables({
|
||||
"currentTiddler": "" + title,
|
||||
@@ -34,7 +35,7 @@ exports.sort = function(operationSubFunction,options) {
|
||||
indexes[t] = t;
|
||||
}
|
||||
// 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) {
|
||||
return compareFn(sortKeys[a],sortKeys[b]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user