From ba13d169fcde27cb7347fd2c3dcd1f9d56c55bdd Mon Sep 17 00:00:00 2001 From: Andrew Plotner Date: Sat, 31 Dec 2022 20:34:09 -0500 Subject: [PATCH] Modify Core::Platform::getLanguage to work with older macOS versions Locale.NSLocale.languageCode was only added in macOS 10.12. However, the same information can be obtained a slightly different way that is non-deprecated and works all the way back to macOS 10.4. This small change makes Etterna compatible with (at least) El Capitan again excepting the known issue with OpenSSL on High Sierra and earlier users. --- src/Core/Platform/PlatformMac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Platform/PlatformMac.mm b/src/Core/Platform/PlatformMac.mm index f958ba455f..3b6da72e18 100644 --- a/src/Core/Platform/PlatformMac.mm +++ b/src/Core/Platform/PlatformMac.mm @@ -112,7 +112,7 @@ Dimensions getWindowDimensions(){ } std::string getLanguage(){ - return NSLocale.currentLocale.languageCode.UTF8String; + return [[NSLocale.currentLocale objectForKey:NSLocaleLanguageCode] UTF8String]; } bool openWebsite(const std::string& url){