SDL_HINT_PREFERRED_LOCALES(3)
π SDL_HINT_PREFERRED_LOCALES π
okay bestie, welcome to the SDL_HINT_PREFERRED_LOCALES page, straight outta the SDL3 FUNCTIONS section of the manual. this one's short, sweet, and honestly kinda iconic. let's get into it π«Ά
β¨ NAME β¨
SDL_HINT_PREFERRED_LOCALES β the override for SDL_GetPreferredLocales(). that's it, that's the whole job. she's a hint, she's here to have opinions about locales π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_hints.h>
#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES"
like, literally that's the whole thing. one include, one define, no cap πΈ
β¨ DESCRIPTION β¨
so here's the tea β β if you set this hint, it gets favored over anything the OS might report for the user's preferred locales. you're basically telling the OS "thanks for your input babe, but I got this" π
β οΈ real talk though: changing this hint at runtime will not generate an SDL_EVENT_LOCALE_CHANGED event. no automatic event for you, sorry bestie π β but if you can change the hint, you can push your own event, if you want. main character energy: you wanna event, you throw the event yourself π
now, the format, because this part matters fr fr:
it's a comma-separated list of language and locale, combined with an underscore, as is a common format: "en_GB". the locale is optional β you can just do "en" if that's the vibe. so you might have a list like this:
"en_GB,jp,es_PT"
see how cute that is? language en, underscore, region GB. then a comma. then just jp being lowkey minimal. then es_PT doing the full thing. all three, one string, slay π
This hint can be set anytime. no timing drama, no "only before init" nonsense. whenever you want, bestie β¨
β¨ AVAILABILITY β¨
this hint is available since SDL 3.2.0. so if you're on anything older, sorry babe, she's not there yet π
and that's the whole page!! short king of a manpage, but every detail ate and left no crumbs π
Simple Directmedia Layer π SDL 3.4.18 π and you just read SDL_HINT_PREFERRED_LOCALES(3) β thanks for stopping by, ily, go set some locales π¦β¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms