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

Add SetThreadUILanguage, SetThreadPreferredUILanguages and GetThreadUILanguage in c.s.j.p.win32.Kernel32 #1514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

overpathz
Copy link
Contributor

Hi.

The SetThreadUILanguage function sets the user interface language for the current thread, which can be useful in situations where you need to ensure consistent language settings across an application. In my project, we are currently calling this function from C++ before starting the Java application, which adds overhead and creates inconsistency.

By adding the SetThreadUILanguage function to Kernel32, you can call it directly from Java code, which would streamline your application's startup process and ensure that language settings are consistent throughout the application. This would eliminate the need to call the function from C++ and would make the code easier to maintain and update.

Copy link
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good to me. I left a few inline comments.

- Bind SetThreadUILanguage, SetThreadPreferredUILanguages and GetThreadUILanguage in c.s.j.p.win32.Kernel32
- test is written
- update CHANGES.md
- remove unused imports in Kernel32.java
@overpathz overpathz force-pushed the provide-thread-language-support branch from e935d9c to f9e5f5b Compare March 29, 2023 18:13
@overpathz
Copy link
Contributor Author

Thanks for the review, supposedly everything has been fixed.

@matthiasblaesing
Copy link
Member

@overpathz thank you for the updates. I pushed the PR to appveyor and got a test failure on x86 (32bit JDK):

https://ci.appveyor.com/project/matthiasblaesing/jna/builds/46657755/job/vf95hkhb08ax9cyx#L2772

The second thing I'd like to ask is whether it is possible to test setThreadPreferredUILanguages with multiple values. You test it with an empty array, which is more than other bindings in the codebase can say, but it would be good. Alternatively, is there a way how I can test it manually?

@overpathz
Copy link
Contributor Author

Yes, thanks, I looked at the test. But unfortunately, at the moment I cannot continue the investigate/implementation due to the fact that the machine with Windows has broken, now only mac.

Therefore, the contribution continues when a new laptop is purchased.

Thanks for understanding.

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

Successfully merging this pull request may close these issues.

2 participants