Fixed language detection on iOS

On iOS you might see traditional Chinese on a US phone as: "zh-Hans_US"
This commit is contained in:
Sam Lantinga
2025-01-03 15:25:12 -08:00
parent 53aaf8c26b
commit 156b3b4a8c

View File

@@ -73,7 +73,7 @@ static SDL_Locale **build_locales_from_csv_string(char *csv, int *count)
loc->language = ptr++; loc->language = ptr++;
while (true) { while (true) {
const char ch = *ptr; const char ch = *ptr;
if (ch == '_' || ch == '-') { if (ch == '_') {
*(ptr++) = '\0'; *(ptr++) = '\0';
loc->country = ptr; loc->country = ptr;
} else if (SDL_isspace(ch)) { } else if (SDL_isspace(ch)) {