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

error language wrong #552

Closed
BlyZeDev opened this issue Nov 2, 2024 · 5 comments
Closed

error language wrong #552

BlyZeDev opened this issue Nov 2, 2024 · 5 comments

Comments

@BlyZeDev
Copy link

BlyZeDev commented Nov 2, 2024

Bug Report

What's the issue you encountered?

When I'm using the error appled the wrong language is diplayed for some reason.
CFG_LANGUAGE_DE gives me French.
CFG_LANGUAGE_FR gives me English.
CFG_LANGUAGE_EN gives me English as well.

How can the issue be reproduced?

errorConf conf;
errorInit(&conf, ERROR_TEXT_LANGUAGE_WORD_WRAP, CFG_LANGUAGE_DE); //Should be in german, but isn't
errorCode(&conf, code);
errorText(&conf, buffer);
errorDisp(&conf);

Environment?

  • Windows 11
  • Official release, newest version
@BlyZeDev
Copy link
Author

BlyZeDev commented Nov 2, 2024

Update: I'm getting german with CFG_LANGUAGE_JP

WinterMute added a commit that referenced this issue Nov 2, 2024
WinterMute added a commit that referenced this issue Nov 2, 2024
@BlyZeDev
Copy link
Author

BlyZeDev commented Nov 2, 2024

When I use ERROR_TEXT flag in errorInit it works perfectly fine

@BlyZeDev
Copy link
Author

BlyZeDev commented Nov 2, 2024

errorConf conf;
errorInit(&conf, ERROR_TEXT, CFG_LANGUAGE_DE); //Works perfectly
errorCode(&conf, code);
errorText(&conf, buffer);
errorDisp(&conf);

I think it could be something wrong with the flags.

@WinterMute
Copy link
Member

errorConf conf;
errorInit(&conf, ERROR_TEXT, CFG_LANGUAGE_DE); //Works perfectly
errorCode(&conf, code);
errorText(&conf, buffer);
errorDisp(&conf);

I think it could be something wrong with the flags.

This isn't doing what you think it's doing. ERROR_TEXT doesn't have the language flag set so it's ignoring the language you pass and using the system language - in your case German it seems. If you use ERROR_TEXT_LANGUAGE you'll end up with the same symptoms.

#553 adds CFG_LANGUAGE_DEFAULT and passes lang + 1 to the system which makes the function behave as expected. Being honest though it seems to me that leaving the language flag unset so errors are displayed in the system language would be a better practice rather than explicitly using a language the user may not speak.

@BlyZeDev
Copy link
Author

BlyZeDev commented Nov 3, 2024

I used it like that, because I didn't know passing nothing would use System Language

CFG_Language getSystemLang()
{
    u8 language;
    CFGU_GetSystemLanguage(&language);

    return language;
}
...
errorInit(&conf, ERROR_TEXT_LANGUAGE_WORD_WRAP, getSystemLang());
...

WinterMute added a commit that referenced this issue Nov 3, 2024
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

2 participants