Files
kryon/include/locale.h
T
waozi b969d0f36b locale: detect the system default locale (GetDefaultLocaleCode)
Apps had no way to follow the system locale - inbe hard-defaulted to
English for every fresh profile. GetDefaultLocaleCode resolves
LANGUAGE/LC_ALL/LC_MESSAGES/LANG down to an available catalog
(pt_BR.UTF-8 -> pt) and returns "en" when nothing matches.
2026-08-18 18:47:28 -03:00

38 lines
734 B
C

#ifndef LOCALE_H
#define LOCALE_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct LocaleEntry {
char *key;
char *value;
} LocaleEntry;
typedef struct LocaleLanguage {
char *code;
char *label;
} LocaleLanguage;
void InitLocale(void);
int SetLocale(const char *code);
const char *GetDefaultLocaleCode(void);
const char *GetLocaleText(const char *key);
void FormatLocaleText(char *dst, size_t dst_size, const char *key, ...);
int GetLocaleCount(void);
const char *GetLocaleCode(int index);
const char *GetLocaleLabel(int index);
int GetLocaleIndex(const char *code);
const char *GetCurrentLocaleCode(void);
int GetCurrentLocaleIndex(void);
#ifdef __cplusplus
}
#endif
#endif // LOCALE_H