Skip to content

Commit

Permalink
Detect iOS system language
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettDong committed Mar 17, 2021
1 parent 9a1187f commit 9c4cc22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/translations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "cata_utility.h"

std::string getOSXSystemLang();
std::string getAppleSystemLang();
#endif

#if defined(__ANDROID__)
Expand Down Expand Up @@ -214,8 +214,8 @@ void set_language()
std::string system_lang;
#if defined(_WIN32)
system_lang = getLangFromLCID( GetUserDefaultLCID() );
#elif defined(MACOSX)
system_lang = getOSXSystemLang();
#elif defined(__APPLE__)
system_lang = getAppleSystemLang(); // macOS and iOS
#elif defined(__ANDROID__)
system_lang = getAndroidSystemLang();
#endif
Expand Down Expand Up @@ -288,8 +288,8 @@ void set_language()
} while( current_language_version == INVALID_LANGUAGE_VERSION );
}

#if defined(MACOSX)
std::string getOSXSystemLang()
#if defined(__APPLE__)
std::string getAppleSystemLang()
{
// Get the user's language list (in order of preference)
CFArrayRef langs = CFLocaleCopyPreferredLanguages();
Expand Down

0 comments on commit 9c4cc22

Please sign in to comment.