/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely.  */
static void log_locales(void)
/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely.  */
static void log_locales(void)
{
    SDL_Locale *locales = SDL_GetPreferredLocales();
    if (locales == NULL) {
        SDL_Log("Couldn't determine locales: %s", SDL_GetError());
    } else {
        SDL_Locale *l;
        unsigned int total = 0;
        SDL_Log("Locales, in order of preference:");
        for (l = locales; l->language; l++) {
            const char *c = l->country;
            SDL_Log(" - %s%s%s", l->language, c ? "_" : "", c ? c : "");
            total++;
        }
        SDL_Log("%u locales seen.", total);
        SDL_free(locales);
    }
}