Closed Bug 752474 Opened 12 years ago Closed 10 years ago

names of languages in the spelling checker are not sorted

Categories

(Core :: Spelling checker, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: amir.aharoni, Assigned: jhorak)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch sort-languages.patch (obsolete) — Splinter Review
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 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+
Fixed nits, do the try test looks good?
Attachment #8369501 - Attachment is obsolete: true
Attachment #8370073 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dfc7a6908299
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: