From cf06258947df2934be7c1c18347b5182583556e5 Mon Sep 17 00:00:00 2001 From: Mark Kim Date: Sat, 12 Feb 2022 22:03:12 -0500 Subject: [PATCH] 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. --- src/i18n.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i18n.c b/src/i18n.c index 9dbffb3e3..b98c7aea1 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -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;