Closed
Bug 1097625
Opened 11 years ago
Closed 11 years ago
Fallback to use LANG variable as dictionary doesn't work
Categories
(Core :: Spelling checker, defect)
Core
Spelling checker
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: jhorak, Assigned: jhorak)
Details
Attachments
(1 file, 1 obsolete file)
2.47 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
Fallback to LANG variable doesn't work when LANG variable contains charset because charset is wrongly cut off.
It also doesn't work on some Linux systems where dictionary files in system has '_' separator instead of '-' and currently code is replacing the '_' by '-' before trying dictionary with underscore first.
Assignee | ||
Comment 1•11 years ago
|
||
Attaching patch with cutoff fix and also trying dictionaries names with '_' (valid for some Linux distros).
Assignee: nobody → jhorak
Attachment #8531582 -
Flags: review?(ehsan.akhgari)
Comment 2•11 years ago
|
||
Comment on attachment 8531582 [details] [diff] [review]
fix-lang-fallback v1
Review of attachment 8531582 [details] [diff] [review]:
-----------------------------------------------------------------
Looks mostly good except for the below. I'd like to look at the final version of the patch.
::: editor/composer/nsEditorSpellCheck.cpp
@@ +866,5 @@
> + int32_t underScore = lang.FindChar('_');
> + if (underScore != -1) {
> + lang.Replace(underScore, 1, '-');
> + }
> + rv = SetCurrentDictionary(lang);
Please move this line inside the if block after Replace(), because it doesn't make sense to call SetCurrentDictionary() twice with the same lang value.
@@ +872,5 @@
> }
> if (NS_FAILED(rv)) {
> rv = SetCurrentDictionary(NS_LITERAL_STRING("en-US"));
> if (NS_FAILED(rv)) {
> + rv = SetCurrentDictionary(NS_LITERAL_STRING("en_US"));
Nit: please add a comment stating that some Linux distros use _ here as well.
Attachment #8531582 -
Flags: review?(ehsan.akhgari)
Assignee | ||
Comment 3•11 years ago
|
||
Adding fixed version.
Attachment #8531582 -
Attachment is obsolete: true
Attachment #8533659 -
Flags: review?(ehsan.akhgari)
Updated•11 years ago
|
Attachment #8533659 -
Flags: review?(ehsan.akhgari) → review+
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #5)
> Is there a Try link handy for this patch? :)
Sure, there it is:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=d99325a230ea
Comment 7•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•