mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 992118 - Correctly handle the underscore in the LANG environment variable; r=smaug
This commit is contained in:
parent
2378f04be0
commit
50a084ff52
@ -752,6 +752,12 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
|
||||
|
||||
// otherwise, get language from preferences
|
||||
nsAutoString preferedDict(Preferences::GetLocalizedString("spellchecker.dictionary"));
|
||||
// Replace '_' with '-' in case the user has an underscore stored in their
|
||||
// pref, see bug 992118 for how this could have happened.
|
||||
int32_t underScore = preferedDict.FindChar('_');
|
||||
if (underScore != -1) {
|
||||
preferedDict.Replace(underScore, 1, '-');
|
||||
}
|
||||
if (dictName.IsEmpty()) {
|
||||
dictName.Assign(preferedDict);
|
||||
}
|
||||
@ -845,6 +851,11 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
|
||||
if (dot_pos != -1) {
|
||||
lang = Substring(lang, 0, dot_pos - 1);
|
||||
}
|
||||
// Replace '_' with '-'
|
||||
int32_t underScore = lang.FindChar('_');
|
||||
if (underScore != -1) {
|
||||
lang.Replace(underScore, 1, '-');
|
||||
}
|
||||
rv = SetCurrentDictionary(lang);
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
|
Loading…
Reference in New Issue
Block a user