-
Notifications
You must be signed in to change notification settings - Fork 13
Query Locale information
Finalspace edited this page May 29, 2026
·
2 revisions
FPL provides a couple of functions for querying the currently configured locale. A locale is written into a caller-provided string buffer in a format described by the fplLocaleFormat enumeration. Currently the only supported format is fplLocaleFormat_ISO639, which produces ISO-639 strings like en-US or de-DE.
FPL distinguishes three kinds of locale:
| Function | Returns the locale of |
|---|---|
| fplGetUserLocale() | The current user account |
| fplGetSystemLocale() | The operating system / system-wide setting |
| fplGetInputLocale() | The active keyboard / input layout |
All three functions share the same signature - pass the desired fplLocaleFormat, a destination buffer and its maximum length. They return the number of characters written, excluding the null terminator.
char localeBuffer[16];
// Query the current user locale, e.g. "en-US"
if ((, localeBuffer, (localeBuffer)) > 0) {
("User locale: %s\n", localeBuffer);
}
// Query the system locale
if ((, localeBuffer, (localeBuffer)) > 0) {
("System locale: %s\n", localeBuffer);
}
// Query the input/keyboard locale
if ((, localeBuffer, (localeBuffer)) > 0) {
("Input locale: %s\n", localeBuffer);
}Note: A return value of zero means the locale could not be determined or the buffer was too small.
- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities