Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language auto doesn't seems to work #27

Closed
shadow2560 opened this issue Dec 18, 2024 · 8 comments
Closed

Language auto doesn't seems to work #27

shadow2560 opened this issue Dec 18, 2024 · 8 comments

Comments

@shadow2560
Copy link
Contributor

At least with french "FR_fr" console, the auto language set the language of the app to English, not tested by set an other console's language . If I force the langauge to French it works.

@ninstar
Copy link
Contributor

ninstar commented Dec 19, 2024

This affects other languages as well, I'm guessing it has something to do with sphaira expecting the locales to have the exact same region code as the one set in the console?

@shadow2560
Copy link
Contributor Author

I don't realy know, I wanted to make some tests by adding some logs in source code but compiling, at least on Windows (environement up to date on Windows 11), seems to be a problem. The first time it compile properly but the second time it doesn't work, "multiple ptarget patterns" error", even if the first compilation doesn't go to the end (compile.make files are modified during build and the second time it doesn't work) so I must delete the "build" folder and re-launch the compilation from the begining, this is too long so I have given up.

@ITotalJustice
Copy link
Owner

Been really busy with work so I won't be able to look at this until a few days.

The call to get the language is here

if (R_SUCCEEDED(setGetSystemLanguage(&languageCode))) {
which should be correct.

I do notice that I don't init set service here

if (R_FAILED(rc = appletLockExit()))
however I thought set was initialised by libnx automatically, maybe I was wrong.

@ITotalJustice
Copy link
Owner

I don't realy know, I wanted to make some tests by adding some logs in source code but compiling, at least on Windows (environement up to date on Windows 11), seems to be a problem. The first time it compile properly but the second time it doesn't work, "multiple ptarget patterns" error", even if the first compilation doesn't go to the end (compile.make files are modified during build and the second time it doesn't work) so I must delete the "build" folder and re-launch the compilation from the begining, this is too long so I have given up.

Can you post the errors when building? Did you build using cmake preset? It should be "cmake --preset Release" to configure and then "cmake --build --preset Release" to build.

@shadow2560
Copy link
Contributor Author

I used these commands except that I use "MinSizeRel" preset, here is the result of the "cmake --build --preset MinSizeRel" command the second time:

cmake : hbl/CMakeFiles/hbl.dir/compiler_depend.make:4: *** multiple target patterns.  Stop.
make[1]: *** [CMakeFiles/Makefile2:217: hbl/CMakeFiles/hbl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
_deps/yyjson-build/CMakeFiles/yyjson.dir/compiler_depend.make:4: *** multiple target patterns.  Stop.
make[1]: *** [CMakeFiles/Makefile2:767: _deps/yyjson-build/CMakeFiles/yyjson.dir/all] Error 2
sphaira/CMakeFiles/libpulsar.dir/compiler_depend.make:4: *** multiple target patterns.  Stop.
make[1]: *** [CMakeFiles/Makefile2:344: sphaira/CMakeFiles/libpulsar.dir/all] Error 2
_deps/minini-sphaira-build/CMakeFiles/minIni-sphaira.dir/compiler_depend.make:4: *** multiple target patterns.  Stop.
make[1]: *** [CMakeFiles/Makefile2:736: _deps/minini-sphaira-build/CMakeFiles/minIni-sphaira.dir/all] Error 2
_deps/nanovg-build/CMakeFiles/nanovg.dir/compiler_depend.make:4: *** multiple target patterns.  Stop.
make[1]: *** [CMakeFiles/Makefile2:612: _deps/nanovg-build/CMakeFiles/nanovg.dir/all] Error 2
[  1%] Built target hbl_npdm
[  2%] Built target fill_vsh
make: *** [Makefile:136: all] Error 2

@shadow2560
Copy link
Contributor Author

I've tried to compile on a ubuntu wsl console and like that it seems to work, it's at least a possibility for me to do my own tests quicker than on my pur Windows environment.

@shadow2560
Copy link
Contributor Author

shadow2560 commented Dec 20, 2024

OK I've found the problem, you seem to not use "setInitialize();" so the condition in "/sphaira/source/i18n.cpp" file "if (R_SUCCEEDED(setGetSystemLanguage(&languageCode))) {" is never true, just as I suspected it.

If you want I can do a pull request but do you prefer I initialize "set" directly in the "i18n.cpp" file (directly in the case for index == 0 and closing the service at the end of the case juste before the break line) or in "main.cpp" file when initializing the app and exiting the service when denitializing the app?

@shadow2560
Copy link
Contributor Author

Finaly I have made a pull request #31 to fix the problem, I fixed it by init and exit the Set service in the main.cpp file. For the cmake compile error on Windows maybe I will open an other issue, for now I close this one cause it is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants