Fix recent macOS changes to be macOS 10.10 compatible

* macOS language detection has been updated to be backward compatible to macOS
  10.10 Yosemite.

It appears older version(s?) of macOS can just return "en" instead of "en-US"
when queried for the preferred locale.  Updated code to account for this.
This commit is contained in:
Mark Kim 2022-02-12 22:03:12 -05:00
parent f4cc875861
commit cf06258947

View file

@ -853,10 +853,10 @@ static const char *locale_to_closest_locale(const char *inlocale)
}
}
/* locale must match at least three characters */
if (outlocale_score < 3)
/* locale must match at least two characters */
if (outlocale_score < 2)
{
outlocale = NULL;
outlocale = "";
}
return outlocale;