mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1048050 - ignore region (or other) subtags when checking for language-specific casing behavior. r=smontagu
This commit is contained in:
parent
dbc6533f43
commit
497902a4a8
@ -2054,7 +2054,7 @@ GK_ATOM(az, "az")
|
||||
GK_ATOM(ba, "ba")
|
||||
GK_ATOM(crh, "crh")
|
||||
GK_ATOM(el, "el")
|
||||
GK_ATOM(ga_ie, "ga-ie")
|
||||
GK_ATOM(ga, "ga")
|
||||
GK_ATOM(nl, "nl")
|
||||
|
||||
// Names for editor transactions
|
||||
|
@ -235,6 +235,9 @@ enum LanguageSpecificCasingBehavior {
|
||||
static LanguageSpecificCasingBehavior
|
||||
GetCasingFor(const nsIAtom* aLang)
|
||||
{
|
||||
if (!aLang) {
|
||||
return eLSCB_None;
|
||||
}
|
||||
if (aLang == nsGkAtoms::tr ||
|
||||
aLang == nsGkAtoms::az ||
|
||||
aLang == nsGkAtoms::ba ||
|
||||
@ -248,9 +251,19 @@ GetCasingFor(const nsIAtom* aLang)
|
||||
if (aLang == nsGkAtoms::el) {
|
||||
return eLSCB_Greek;
|
||||
}
|
||||
if (aLang == nsGkAtoms::ga_ie) {
|
||||
if (aLang == nsGkAtoms::ga) {
|
||||
return eLSCB_Irish;
|
||||
}
|
||||
|
||||
// Is there a region subtag we should ignore?
|
||||
nsAtomString langStr(const_cast<nsIAtom*>(aLang));
|
||||
int index = langStr.FindChar('-');
|
||||
if (index > 0) {
|
||||
langStr.Truncate(index);
|
||||
nsCOMPtr<nsIAtom> truncatedLang = do_GetAtom(langStr);
|
||||
return GetCasingFor(truncatedLang);
|
||||
}
|
||||
|
||||
return eLSCB_None;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user