names of languages in the spelling checker are not sorted

RESOLVED FIXED in mozilla30

Status

()

Core
Spelling checker
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: Amir Aharoni, Assigned: jhorak)

Tracking

unspecified
mozilla30
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
The names of the languages in the list of spelling dictionaries is not sorted and apparently random. When many spelling dictionaries are installed, it's very hard to find the needed language. They must be sorted alphabetically.
(Assignee)

Comment 1

4 years ago
Created attachment 8369501 [details] [diff] [review]
sort-languages.patch

Fedora users hitting this issue too. They are shown ~ 20 dictionaries just for english. Attaching patch which sort this list.
Assignee: nobody → jhorak
Attachment #8369501 - Flags: review?(ehsan)

Comment 3

4 years ago
Comment on attachment 8369501 [details] [diff] [review]
sort-languages.patch

Review of attachment 8369501 [details] [diff] [review]:
-----------------------------------------------------------------

We have a number of tests which test the context menu, and you may need to change the expected results of those tests before being able to check this patch in.  Please test on the try server before landing.

Thanks a lot for your patch!

::: toolkit/modules/InlineSpellChecker.jsm
@@ +166,3 @@
>      for (var i = 0; i < list.length; i ++) {
> +      sortedList.push({"spellcheck_id":list[i],
> +                       "spellcheck_label": this.getDictionaryDisplayName(list[i])});

Nit: I think this code will be more readable if you just name these fields id and label.

@@ +166,5 @@
>      for (var i = 0; i < list.length; i ++) {
> +      sortedList.push({"spellcheck_id":list[i],
> +                       "spellcheck_label": this.getDictionaryDisplayName(list[i])});
> +    }
> +    sortedList.sort(function(a, b) { 

Nit: Please remove the trailing space.
Attachment #8369501 - Flags: review?(ehsan) → review+
(Assignee)

Comment 5

4 years ago
Created attachment 8370073 [details] [diff] [review]
sort-languages.patch

Fixed nits, do the try test looks good?
Attachment #8369501 - Attachment is obsolete: true
Attachment #8370073 - Flags: review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dfc7a6908299
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.