SDL 3.0
SDL_Locale Struct Reference

#include <SDL_locale.h>

Data Fields

const char * language
const char * country

Detailed Description

CategoryLocale

SDL locale services.

This provides a way to get a list of preferred locales (language plus country) for the user. There is exactly one function: SDL_GetPreferredLocales(), which handles all the heavy lifting, and offers documentation on all the strange ways humans might have configured their language settings. A struct to provide locale data.

Locale data is split into a spoken language, like English, and an optional country, like Canada.

Language strings are ISO-639 language specifiers (such as "en" for English, "de" for German, etc). Country strings are ISO-3166 country codes (such as "US" for the United States, "CA" for Canada, etc). The country might be NULL if there's no specific guidance on them (so you might have { "en", "US" } for American English, but { "en", NULL } means "English language, generically"). Language strings are never NULL.

Please note that not all of these strings are 2 characters; some are three or more.

Since
This struct is available since SDL 3.2.0.
See also
SDL_GetPreferredLocales

Definition at line 68 of file SDL_locale.h.

Field Documentation

◆ country

const char* SDL_Locale::country

A country, like "US" for America. Can be NULL.

Definition at line 71 of file SDL_locale.h.

◆ language

const char* SDL_Locale::language

A language name, like "en" for English.

Definition at line 70 of file SDL_locale.h.


The documentation for this struct was generated from the following file: