From 0e72ee3305478617b8c70262ef121eb6b37796cb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Dec 2016 19:24:39 -0500 Subject: [PATCH] Sort translators in import filepicker drop-down --- chrome/content/zotero/fileInterface.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index b458b3d520..4c446ccdf0 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -224,8 +224,11 @@ var Zotero_File_Interface = new function() { fp.init(window, Zotero.getString("fileInterface.import"), nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterAll); - for(var i in translators) { - fp.appendFilter(translators[i].label, "*."+translators[i].target); + + var collation = Zotero.getLocaleCollation(); + translators.sort((a, b) => collation.compareString(1, a.label, b.label)) + for (let translator of translators) { + fp.appendFilter(translator.label, "*." + translator.target); } var rv = fp.show();