The default bug view has changed. See this FAQ.

When unable to find dictionary try also LANG variable to determine dictionary

RESOLVED FIXED in mozilla14

Status

()

Core
Spelling checker
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jan Horak, Assigned: Jan Horak)

Tracking

Trunk
mozilla14
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 615716 [details] [diff] [review]
patch 0.1

Mozilla tries to determine spell check dictionary by using locale. This doesn't work for Linux distributions which wants to share dictionaries across the system. In this case it picks the first available dictionary as default. 

Attaching patch which tries to set dictionary from LANG environment variable just before 'en-US' will be tried. Please have a look.
(Assignee)

Updated

5 years ago
Attachment #615716 - Flags: review?(ehsan)
Comment on attachment 615716 [details] [diff] [review]
patch 0.1

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

::: editor/composer/src/nsEditorSpellCheck.cpp
@@ +752,5 @@
> +      if (env_lang != nsnull) {
> +        nsString lang = NS_ConvertUTF8toUTF16(env_lang);
> +        // strip charset if there is any
> +        PRInt32 pos;
> +        if ( (pos = lang.FindChar('.')) != -1) {

Nit: please call FindChar on the previous line, and just compare in the condition.

@@ +761,2 @@
>        if (NS_FAILED(rv)) {
> +        rv = SetCurrentDictionary(NS_LITERAL_STRING("en-US"));

Why do you need to assume en-US first here?
(Assignee)

Comment 2

5 years ago
Created attachment 616078 [details] [diff] [review]
patch 0.2

I'm little confused here, the en-US used to be here before, I've just added LANG check before trying en-US. Or do you mean the en-US should have higher priority?
Assignee: nobody → jhorak
Attachment #615716 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #615716 - Flags: review?(ehsan)
Attachment #616078 - Flags: review?(ehsan)
Comment on attachment 616078 [details] [diff] [review]
patch 0.2

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

No, sorry, I just read the patch incorrectly.  r=me.

Note for the drivers: this does not impact Fennec as spellchecking is currently disabled there.
Attachment #616078 - Flags: review?(ehsan)
Attachment #616078 - Flags: review+
Attachment #616078 - Flags: approval-mozilla-central?
Attachment #616078 - Flags: approval-mozilla-central? → approval-mozilla-central+
https://hg.mozilla.org/integration/mozilla-inbound/rev/6294c13ee51e

Thanks for your patch!
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/6294c13ee51e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.