IDE launched program not using localized language
Hi all. So I am investigating a bug that occurs for a specific language (let's say German for sake of argument). So I configure my system to display German and can run the deployed version of our application and see a formatting issue that occurs when using German. So now I try to launch the application via my IDE so I can run through the break points and try to locate what's triggering the formatting issue. However, when I launch via IDE the application is using the English language and format.
How do I ensure the IntelliJ IDE is using the localized language setting. To be clear, I don't want to change IntelliJ but simply my application that is launched from IntelliJ. I would expect the application to look the same whether I run from IntelliJ or from deployed application.
Appreciate any help because so far I can't seem to track down this setting/configuration.
Please sign in to leave a comment.
Hows does your app determine the language to use? Do you use the standard resource bundles?
You may need to specify the language in the VM Options filed like this: -Duser.language=de -Duser.region=DE
Serge,
To be honest I'm not entirely sure. It's a very large application developed over many years that takes years to even partially understand. I'm a relatively new developer to the project who got task with looking into why this single language has a formatting issue on a single screen.
I'll have to ask regarding the resource bundle, but I'd lean towards yes. Also I tried updating the VM options as you identified, but when I bring up the screen it is still using the English format and not the localized language. (It prompted me to create a .vmoptions file. Other then adding that line and saving it, is there anything else that needs done to ensure my 'run' actually uses that?)
You need to specify it in the application run/debug configuration, not in IntelliJ IDEA VM Options:
https://www.jetbrains.com/help/idea/run-debug-configuration-application.html
Serge,
Thanks, when I googled it took me to the latter. I made the changes to the run config (Update Configuration->VM options with specified param), but still see the English format.
Ok. I was mistaken. The language did take effect. So the problem I'm investigating appears to be more complicated then it appears.
[We have a number field that should match per localized language. However, on one page it is not formatting correctly. This issue only appears when using a certain language on a system. However making this a pain, is the problem formatting does not appear when I set the localized language from IDE. I even verified that some language buttons changed, but the format is not correct.] So off I go to dig further in this.
You need to find out how your app chooses the language and launch it with the appropriate options. Also make sure the languages are available to the app when it's started from IntelliJ IDEA. You may have some custom build scripts which are not invoked and don't build the localization files when the app is compiled from the IDE or some resource folders may be not configured properly.