-
Notifications
You must be signed in to change notification settings - Fork 819
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
Include an option in wsl command to force the output to English #7654
Comments
@crramirez - I would suggest just keying off the process exit code, which should be 0 on success and nonzero on failure. |
OK I didn't know this work for this command. I'll test. This will solve me this punctual problem. Nevertheless, I would like this should implemented parsing for example wsl --list --verbose is complicated with localization. Also scanning the wsl --help results to guess which wsl capabilities are available. Thanks for the suggestion |
I think making wsl --list --verbose 's output easier to parse is a good suggestion. Maybe adding a flag to suppress all localized strings in that command would be the simplest If you need to dynamically scan for WSL features, the simplest would be to use WSL from the Microsoft store and have a minimum version number |
@benhillis checking the exit codes works very well. @OneBlue the WSL from the Store is not an option for me. It is only available in Windows 11. Windows 10 1909 is still supported and it has a WSL version different from Windows 10 2004 and Windows 11 and also the store version. This is why I scan the wsl --help. |
There is another way which doesn't require parsing the output while exporting distro, you-know-how 🤐 |
Is your feature request related to a problem? Please describe.
When writing programs or script that calls the wsl command and parses the output, it is challenging if it changes depending on the language installed on the PC. For example, now in the WSL Store version if I call wsl --export, depending on the output I must guess the result. Before this change, no output meant success. Now I must parse the output.
Describe the solution you'd like
I want an option to be added like --force-english-output or --force-locale-output XX to the wsl command to output in a language different from the installed one.
The text was updated successfully, but these errors were encountered: