Fix error code returned by setGetSystemLanguage

Now we get an empty string, hm.
This commit is contained in:
Joel16 2018-05-17 12:20:43 -05:00
parent f9ddb9a0d0
commit f60394002c

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <string.h>
#include <switch.h>
@ -7,37 +8,12 @@
const char *SwitchIdent_GetLanguage(void)
{
Result ret = 0;
const char *languages[] =
{
"Japanese",
"US English",
"French",
"German",
"Italian",
"Spanish",
"Simplified Chinese",
"Korean",
"Dutch",
"Portugese",
"Russian",
"Traditional Chinese",
"UK English",
"Canadian French",
"Latin American Spanish",
"Unknown"
};
u64 language = 0;
if (R_SUCCEEDED(ret = setGetSystemLanguage(&language)))
{
if (language < 15)
return languages[language];
}
if (R_FAILED(ret = setGetSystemLanguage(&language)))
printf("setGetSystemLanguage(language) failed: 0x%x.\n\n", ret);
printf("setGetSystemLanguage(language) failed: 0x%x.\n\n", ret);
return languages[15];
return strupr((char*)&language);
}
// Not sure about this yet.