GUI form support for multiple languages

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jpbobrek
Posts: 25
Last visit: Sat Dec 23, 2023 1:52 pm

GUI form support for multiple languages

Post by jpbobrek »

One of the powershell GUI scripts I wrote the company wants me to make available in Spanish as well as English. Here are the ways I was thinking to accomplish this:
1.) Query the OS language. If Spanish, display Spanish verbiage. Else, use English. Con to this is that some Spanish speakers may use English as their OS default.
2.) Have two versions: one script that does english and one that does spanish. Con to this is knowing which version to deploy to a user's system.
3.) Always display English, but have a link at the bottom of the form "En español" that would switch the verbiage in the existing form and retain the preference in a config file.

Does anyone have an example of how to implement this or a recommended approach?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: GUI form support for multiple languages

Post by jvierra »

Make all strings virtual and load from a file. You can use Export/Import CliXml to do this. The issue you will have is making the form behave with different strings..

PowerShell has not support for MUI. It must be done by hand.
This topic is 7 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked