Windows Forms Localization
Localize a Windows Forms application without changing its code: Soluling reads your Visual Studio project or the compiled assembly, lets you translate the forms in a visual editor, checks the translations, and builds a satellite assembly for each language.
Soluling supports every Windows Forms application from .NET Framework 1.0 to the latest .NET. This guide uses the Driving sample, a small driving time calculator, and takes it from an English-only application to one that speaks Finnish, German, and Japanese and can change its language while it runs.
Driving.exe. Soluling adds a satellite assembly, Driving.resources.dll, for each language next to it.- Input
- Visual Studio project or solution (
.csproj,.vbproj,.sln,.slnx), assembly (.exe,.dll), or resource file (.resx) - Output
- Satellite assemblies (
fi\Driving.resources.dll), localized assemblies, or localized.resxfiles - Runtime
- .NET loads the language of the current UI culture; Soluling's library adds a runtime language switch
- Preview
- Visual form editor with the real Windows Forms controls
On this page
- Tutorial: localize a Windows Forms application step by step
- How Windows Forms localization works
- Culture fallback
- Choose and change the language
- Translate in Soluling Cloud
- Do and don't
- Typical localizability problems
- Troubleshooting
- The Driving sample
- FAQ
Localize a Windows Forms application, step by step
Six steps take the Driving sample from a hard-coded English application to localized satellite assemblies.
Prepare: make the application localizable
The original Driving application works, but it cannot be localized. It writes its result with code like this:
hoursLabel.Text = hours + " hour(s)";
minutesLabel.Text = minutes + " minute(s)";
Those strings are in the code, so they stay English in every language, and "hour(s)" avoids plural forms that many languages need. Internationalizing the application takes three changes:
-
Set
Localizabletotrueon every form and user control. Visual Studio then stores the texts, sizes, and positions of the controls in the form's.resxfile instead of the code. A form with the defaultfalsehas nothing for Soluling to translate. -
Move the strings from code to resources. Add them to
Properties\Resources.resxwith meaningful names, such asAbout, and useProperties.Resources.Aboutin the code. Add a comment to a resource string to give the translator more context. -
Use one pattern for sentences with numbers. Don't build a sentence from pieces. The Driving sample stores the whole result as an ICU message pattern with plural forms, and formats it with
MultiPattern.FormatMultifrom Soluling's .NET library. Soluling recognizes the pattern and shows the translator the plural forms the target language needs. See patterns.
zero form for the hours, so "0 hours" is left out. Plural forms are simplified here.Not sure what is left in the code? Build a pseudo-translated version first (step 04). Strings that stay in English in a pseudo-translated build are still hard-coded.
Add: create a Soluling project
Build the application in Visual Studio first; Soluling needs the compiled assemblies when it builds. Then drag and drop one of these on Soluling. Project Wizard starts.
-
The Visual Studio project or solution (
Driving.csproj,.sln). This is the recommended way. Soluling finds every resource file the project uses, and a solution picks up new projects automatically. -
The compiled assembly (
Driving.exe). You don't need the source code. On .NET 5 and later, add the main.dll; the.exewith the same name is only a native launcher.
Project and binary localization compares the two: the comments compiling drops from every .resx, and when the assembly is the right source.
On the Resources page, keep the default resource types, ResX and Form. If the application has been localized before, Soluling finds the existing localized files, such as Form1.fi.resx, and imports their translations. On the Languages page, add the target languages, and click Finish.
Translate: in the grid and the visual form editor
Each form appears in the project tree with its strings in the grid. Select a form, and the visual form editor shows it as it looks in the selected language, drawn with the real Windows Forms controls. Selecting a row highlights its control, and you can move and resize controls if a translation does not fit.
- Machine translation and translation memory. Click Use Machine Translation to translate with Amazon, Claude, DeepL, Google, Microsoft, ModernMT, or MyMemory, and reuse earlier translations from translation memory and terminology.
- External translators. Send a translation package, an Excel file, or XLIFF to a translator, and import the results back. See teamwork.
- Translators in a browser. Upload the project to Soluling Cloud and let translators work in Translate.
& marks the hotkey. Soluling keeps it in the translation and checks that hotkeys are not duplicated.Check: find problems before release
Pseudo translation. Click Translate | Pseudo Translations | Fill, build, and run the application. Pseudo translations are longer and use accented characters, so texts that don't fit and strings still in the code (shown in plain English) stand out. See pseudo translation.
Pseudo-translated Original build
Validation. Soluling validates translations while you type and in batch (Validation | Validate Translations): missing translations, inconsistent placeholders and patterns, duplicate hotkeys, and more. See validation.
Validation: German
Build: create the satellite assemblies
Choose Home | Build All. Soluling compiles a satellite assembly for each language into a language folder next to the original assembly, using the names .NET looks for. Choose Home | Run Localized to start the application in a target language.
On the Output sheet of the source, you can instead create localized assemblies: full copies of Driving.exe with the translated resources inside, one per language, that replace the original. With the resource file method, Soluling writes localized .resx files, and Visual Studio compiles the satellite assemblies (SDK-style projects include them automatically).
Update: translate only what changed
When the application changes, build it in Visual Studio and click Home | Scan. Soluling compares the new forms and resources with the project, keeps the existing translations, adds the new strings, and marks the rows whose original text changed so that their translations are checked again. Rows are matched by their context (the control and property name), so keep control and resource names stable. Translate the new rows and build again.
You can automate the scan and build steps in your build pipeline with the SoluMake command-line tool.
Localizable forms keep their text in resources; languages ship as satellite assemblies
When a form's Localizable property is true, the Windows Forms designer writes the form's texts, sizes, and positions into Form1.resx, and InitializeComponent loads them from there with ComponentResourceManager. The compiler embeds the neutral (original language) resources into the main assembly. A satellite assembly contains the same resources in one language. At runtime, .NET loads the resources of the current UI culture (CultureInfo.CurrentUICulture) from the matching language folder.
Because sizes and positions are resources too, a translation can have its own layout: if German needs a wider label, resize it in the visual form editor for German only.
Culture fallback
.NET looks up each resource separately: first in the specific culture (fi-FI), then in its parent (fi), and finally in the neutral resources of the main assembly. So a missing translation shows in English instead of failing, and one fi folder serves every Finnish locale. Add the neutral language, such as Finnish (fi), as the target language, and add a country-specific language only when it really differs, for example de-CH.
Choose and change the language
By default, .NET uses the Windows display language. Soluling's .NET library, available as the Soluling NuGet package, adds two things: an initial language that follows the user's locale or a saved choice, and a runtime language switch.
// Program.cs: set the initial language before the first form is created
[STAThread]
static void Main()
{
Soluling.Language.SetInitial(Properties.Settings.Default.Language);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
SelectLanguage.Select shows the languages that have a satellite assembly, loads the selected language, and translates the open forms without restarting the application. Texts set in code are not in the form resources, so set them again after the switch:
// Form1.cs in the Multilingual version of the Driving sample
private void languageToolStripMenuItem_Click(object sender, EventArgs e)
{
if (SelectLanguage.Select())
{
Properties.Settings.Default.Language = Soluling.Language.Culture.Name;
Properties.Settings.Default.Save();
// Set the texts that the code sets, such as the result, again in the new language
UpdateItems();
}
}
Translate in Soluling Cloud
With Soluling Cloud, translators use Translate in a browser. How you start depends on what you localize:
- String resources (
.resx). UploadProperties\Resources.resxon the dashboard, translate, and download the localized.resxfiles. Visual Studio compiles the satellite assemblies. - Forms, Visual Studio projects, and assemblies. Soluling Cloud can't scan these itself. Create the project in Soluling Desktop, and choose Translate | Configure Cloud to upload it. Use Import from Cloud to get the translations back and build the localized files locally. Your application files never leave your machine.
To run the scan, upload, import, and build steps in your build pipeline, use SoluMake. See the Cloud tutorial and workflows.
Do and don't
Do
- Set
Localizable = trueon every form and user control. - Give resource strings meaningful names, and add comments for the translator.
- Store whole sentences with placeholders, and use plural patterns for numbers.
- Keep control and resource names stable after translation starts.
- Use
AutoSizeand layout panels, so controls grow with longer text. - Pseudo-translate before the first real translation.
Don't
- Set UI text in code after
InitializeComponent; it stays in the original language. - Build sentences from pieces, such as
hours + " hour(s)". - Rename controls without a reason; renamed rows lose their translations.
- Rename or move the satellite assemblies.
- Set the culture after the first form has been created, unless you use the runtime language switch.
Typical localizability problems
See also internationalization and pseudo translation.
| Problem | How it shows | Find and fix |
|---|---|---|
| The form is not localizable | The form has no rows in Soluling, or only a few | Set Localizable to true in Visual Studio, rebuild, and scan. |
| Strings in code | English text in a pseudo-translated build | Move the strings to Resources.resx. |
| Sentences built from pieces | Word order and plurals are wrong in the translation | Use one string with placeholders, or a plural pattern. |
| Controls only fit English | Clipped text in the pseudo or German build | Use AutoSize and layout panels, or resize the control per language in the visual form editor. |
| Hotkeys collide | Alt+letter selects the wrong control | Validation finds duplicate hotkeys. |
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The application stays in English | The UI culture has no matching language folder, or the satellite assemblies were not deployed | Check that fi\Driving.resources.dll is next to the main assembly, and set the language with Soluling.Language.SetInitial. |
| Some texts stay in English after a runtime language switch | The code sets those texts | Set them again after SelectLanguage.Select returns true. |
| A form is missing from the visual form editor or shows stand-ins | Soluling cannot load a 3rd party or custom control | The editor maps the control to the nearest standard control; you can still translate, move, and resize it. |
| Building fails | The application was not built, or the build is older than the project | Build the application in Visual Studio first, then scan and build in Soluling. |
| A property is not in the project | The scan rules exclude it, or the component does not store it in the .resx |
Check the scan rules, and that the property is in the form's .resx. |
The Driving sample
The sample is in Samples\WindowsForms\Driving of the Soluling installation and on GitHub. It has three versions of the same application:
- Original: the English application before internationalization, with hard-coded strings.
- Localized: internationalized, with a Finnish translation and plural patterns.
- Multilingual: as above, with a runtime language switch.
The Samples\WindowsForms folder has many more samples, for example, 3rd party controls, right-to-left languages, and inherited forms. See Windows Forms localization in the Desktop documentation for all the details.
FAQ
.exe or .dll and builds the satellite or localized assemblies from it. You need the source code only to fix internationalization problems, such as hard-coded strings..resx files in source control or want to translate them in Soluling Cloud directly. Forms work best with the project or assembly method, because they get the scan rules and the visual form editor.Form1.fi.resx, and imports their translations. Sisulizer and Multilizer projects can be converted. See migration..dll, and that is the file to localize.Related
- Windows Forms localization - the full Desktop documentation
- .NET localization - resource files, satellite assemblies, and other .NET applications
- Runtime language change - in .NET and other platforms
- Supported formats - everything else Soluling localizes