#include "../SDL_syslocale.h"
#include "../../SDL_internal.h"
#include <3ds.h>
#define BAD_LOCALE 255
SDL_FORCE_INLINE u8 GetLocaleIndex(void);
void
SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{
static const char AVAILABLE_LOCALES[][6] = { "ja_JP", "en_US", "fr_FR", "de_DE",
"it_IT", "es_ES", "zn_CN", "ko_KR",
"nl_NL", "pt_PT", "ru_RU", "zh_TW" };
u8 current_locale = GetLocaleIndex();
if (current_locale != BAD_LOCALE) {
SDL_strlcpy(buf, AVAILABLE_LOCALES[current_locale], buflen);
}
}
SDL_FORCE_INLINE u8
GetLocaleIndex(void)
{
u8 current_locale;
if (R_FAILED(cfguInit())) {
return BAD_LOCALE;
}
if (R_FAILED(CFGU_GetSystemLanguage(¤t_locale))) {
return BAD_LOCALE;
}
cfguExit();
return current_locale;
}