From 6dbb3214dfaa300f87f455710cdddf674c5aa604 Mon Sep 17 00:00:00 2001 From: Ginn Chen Date: Wed, 24 Jun 2009 14:06:58 +0800 Subject: [PATCH] Bug 499660 Firefox should use English dictionary by default with CJK locale r=neil --- editor/composer/src/nsEditorSpellCheck.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/composer/src/nsEditorSpellCheck.cpp b/editor/composer/src/nsEditorSpellCheck.cpp index efbe8b83374..d99625f6be4 100644 --- a/editor/composer/src/nsEditorSpellCheck.cpp +++ b/editor/composer/src/nsEditorSpellCheck.cpp @@ -210,6 +210,12 @@ nsEditorSpellCheck::InitSpellChecker(nsIEditor* aEditor, PRBool aEnableSelection PRBool setDictionary = PR_FALSE; if (NS_SUCCEEDED(rv) && !dictName.IsEmpty()) { rv = SetCurrentDictionary(dictName.get()); + + // fall back to "en-US" if the current locale doesn't have a dictionary. + if (NS_FAILED(rv)) { + rv = SetCurrentDictionary(NS_LITERAL_STRING("en-US").get()); + } + if (NS_SUCCEEDED(rv)) setDictionary = PR_TRUE; }