Cover new Chinese and Brazilian Portuguese language IDs for nacpGetLanguageEntry

This commit is contained in:
MasaGratoR 2025-07-13 20:32:04 +02:00 committed by GitHub
parent 70ea18a477
commit 96f063ac13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@
#include "services/set.h"
#include "nacp.h"
static u32 g_nacpLanguageTable[15] = {
static u32 g_nacpLanguageTable[18] = {
[SetLanguage_JA] = 2,
[SetLanguage_ENUS] = 0,
[SetLanguage_ENGB] = 1,
@ -22,7 +22,10 @@ static u32 g_nacpLanguageTable[15] = {
[SetLanguage_RU] = 11,
[SetLanguage_KO] = 12,
[SetLanguage_ZHTW] = 13,
[SetLanguage_ZHHANT] = 13,
[SetLanguage_ZHCN] = 14,
[SetLanguage_ZHHANS] = 14,
[SetLanguage_PTBR] = 15
};
//Official sw uses nsam for this, but since that's a privileged service, use set-service instead for compatibility with newer system-versions.
@ -49,7 +52,7 @@ Result nacpGetLanguageEntry(NacpStruct* nacp, NacpLanguageEntry** langentry) {
if (Language < 0)
rc = MAKERESULT(Module_Libnx, LibnxError_BadInput);
if (R_SUCCEEDED(rc) && Language >= 15)
if (R_SUCCEEDED(rc) && Language >= 18)
Language = SetLanguage_ENUS;//Use ENUS for unsupported system languages.
setExit();