Windows Forms

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.

Download Soluling

You build C# Driving.csproj Soluling 150 60 Driving Time Driving distance: Speed: Round time Calculate Fahrzeit Fahrstrecke: Geschwindigkeit: Ungefähre Uhrzeit Berechnen The form as it is in the project has been translated in the visual editor You ship EXE Driving.exe fi fi\Driving.resources.dll de de\Driving.resources.dll ja ja\Driving.resources.dll A satellite assembly for each language, next to Driving.exe You build C# Driving.csproj Soluling 150 60 Driving Time Driving distance: Speed: Round time Calculate Fahrzeit Fahrstrecke: Geschwindigkeit: Ungefähre Uhrzeit Berechnen The form as it is in the project has been translated in the visual editor You ship EXE Driving.exe fi fi\Driving.resources.dll de de\Driving.resources.dll ja ja\Driving.resources.dll A satellite assembly for each language, next to Driving.exe
You keep shipping the same 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 .resx files
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

Six steps take the Driving sample from a hard-coded English application to localized satellite assemblies.

01

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:

  1. Set Localizable to true on every form and user control. Visual Studio then stores the texts, sizes, and positions of the controls in the form's .resx file instead of the code. A form with the default false has nothing for Soluling to translate.
  2. Move the strings from code to resources. Add them to Properties\Resources.resx with meaningful names, such as About, and use Properties.Resources.About in the code. Add a comment to a resource string to give the translator more context.
  3. 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.FormatMulti from Soluling's .NET library. Soluling recognizes the pattern and shows the translator the plural forms the target language needs. See patterns.
Moving hard-coded strings to a resource pattern The hard-coded hours and minutes strings stay English and have no plural rules. After internationalizing, the code reads the ResultPlural resource, which has an English and a Finnish plural pattern. Before: Original\Form1.cs hoursLabel.Text = hours + " hour(s)"; minutesLabel.Text = minutes + " minute(s)"; ✕ Stays English, no plural forms Internationalize After: Localized\Form1.cs resultLabel.Text = MultiPattern.FormatMulti(Properties.Resources.ResultPlural, hours, minutes); Properties\Resources.resx and Resources.fi.resx ResultPlural English Driving time is{plural, one { {0} hour } other { {0} hours }}{plural, one {{0} minute} other {{0} minutes}} Finnish Ajoaika on{plural, one { {0} tunti } other { {0} tuntia }}{plural, one {{0} minuutti} other {{0} minuuttia}} ✓ Translated with the forms, with the plural forms of each language
The sample's real pattern also has a 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.

02

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 .exe with 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.

Project Wizard Driving.csproj goes through Project Wizard's Resources page (ResX and Form selected), Existing translations page (Form1.fi.resx and Resources.fi.resx found), and Languages page (Finnish, German, Japanese). Drop Driving.csproj or Driving.exe or .sln Resources ☑ ResX ☑ Form ☐ Image, Icon, ... Existing translations Form1.fi.resx Resources.fi.resx ✓ Imported Languages Finnish (fi) German (de) Japanese (ja) The Existing translations page appears only when Soluling finds localized files.
03

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.
The translation grid and the visual form editor The grid lists the Form1 strings with Finnish translations. The selected row, Driving distance, is highlighted on the Finnish form in the visual editor. Grid: Form1 Context English Finnish $this.Text Driving Time Ajoaika fileToolStripMenuItem &File &Tiedosto distanceLabel &Driving distance: &Ajomatka: sizeLabel &Speed: &Nopeus: calculateButton &Calculate &Laske resultLabel (set in code) Visual form editor: Finnish Ajoaika FI ✕ Tiedosto Ohje Ajomatka: 220 Nopeus: 88 Laske Ajoaika on 2 tuntia 30 minuuttia
The & marks the hotkey. Soluling keeps it in the translation and checks that hotkeys are not duplicated.
04

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

[Ðŕîvîñĝ Ţîɱé ___] PS ✕ [Ƒîļé __] [Ĥéļþ __] [Ðŕîvîñĝ ðîšţåñçé: ____________________] 220 [Šþééð: __________] 88 [Çåļçûļåţé ___] 2 hour(s) 30 minute(s) Too long and still English (hard-coded)

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

⚠ Inconsistent format string ResultPlural Original uses {0} in both plural forms; the translation uses {1}: ... {plural, one {{1} Minute} other {{1} Minuten}} ⚠ Duplicate hotkey &Fahrstrecke: / &Fahrzeit berechnen Both use Alt+F on the same form, so change one of them.
05

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).

Satellite assemblies and localized assemblies With satellite assemblies, bin\Release contains the unchanged Driving.exe and fi, de, and ja folders, each with Driving.resources.dll. With localized assemblies, each language folder contains a complete Driving.exe in that language. Satellite assemblies (default) DIR bin\Release\ EXE Driving.exe original, unchanged fi fi\Driving.resources.dll de de\Driving.resources.dll ja ja\Driving.resources.dll Localized assemblies (complete copies) DIR bin\Release\ EXE Driving.exe original, English fi fi\Driving.exe de de\Driving.exe ja ja\Driving.exe
Deploy the language folders as they are. If a satellite assembly is renamed or moved, .NET does not find it.
06

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.

Reference

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.

Resource lookup for the fi-FI UI culture For UI culture fi-FI, the fi-FI folder is not shipped. Driving distance and Calculate are found in the fi folder as Ajomatka and Laske. About was not translated, so it comes from the neutral resources in Driving.exe. UI culture: fi-FI fi-FI\ not shipped fi\Driving.resources.dll Driving.exe neutral (English) distanceLabel.Text – ✓ Ajomatka: calculateButton.Text – ✓ Laske About – not translated ✓ Driving time calculator

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();
  }
}
Runtime language switch The English Driving Time form, the Select Language dialog with English, Suomi, Deutsch, and Japanese, and the same form in Finnish without restarting. Driving Time EN ✕ File Help Driving distance: 220 Speed: 88 Calculate Driving time is 2 hours 30 minutes Select Language English suomi Deutsch 日本語 OK Ajoaika FI ✕ Tiedosto Ohje Ajomatka: 220 Nopeus: 88 Laske Ajoaika on 2 tuntia 30 minuuttia Same window, no restart

Translate in Soluling Cloud

With Soluling Cloud, translators use Translate in a browser. How you start depends on what you localize:

  • String resources (.resx). Upload Properties\Resources.resx on the dashboard, translate, and download the localized .resx files. 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 = true on 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 AutoSize and 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

No. With the assembly file method, Soluling reads the compiled .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.

Yes. Soluling's .NET library translates the open forms from the satellite assembly of the new language. See Choose and change the language and the Multilingual version of the Driving sample.

Use the Visual Studio project or solution when you have the source: Soluling finds every resource file and builds the satellite assemblies. Use the assembly when you only have the build. Use resource files when you want the localized .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.

Yes. When you create the project, Soluling finds existing localized files, such as Form1.fi.resx, and imports their translations. Sisulizer and Multilizer projects can be converted. See migration.

Yes, every Windows Forms application from .NET Framework 1.0 to the latest .NET. On .NET 5 and later, the main assembly is the .dll, and that is the file to localize.

Related

All guides