Adding MUI language

Notepad3 is a fast, lightweight text editor for Windows. It is built on the Scintilla engine and designed as a powerful replacement for the default Notepad.​

One of its standout features is support for a Multilingual User Interface (MUI), which allows the entire application interface (menus, dialogs, messages) to be translated into different languages. Adding language support via MUI is extremely useful for reaching a wider audience – users can run Notepad3 in their native language without modifying the core program. Notepad3 already includes many languages (e.g. Dutch, Italian, Chinese, etc.), and even more can be added through community translations.​

In this guide, we’ll walk through a step-by-step process targeted at developers and volunteer translators on how to add a new MUI language to Notepad3. Following these steps, you can create a fully translated Notepad3 UI for a new language (for example, Italian or Dutch) and contribute it back to the project so others can benefit.

Adding MUI Languge in Notepad3
Notepad3’s main window has the language set to Japanese (ja-JP). Adding MUI language support allows all menus, dialog texts, and messages to be displayed in the new language.

Prerequisites

Git and GitHub – You will need Git to clone the Notepad3 repository and optionally fork it on GitHub if you plan to contribute your changes. Familiarize yourself with basic Git commands or use GitHub Desktop for an easier GUI approach​.

Development Environment – Setting up a development environment is necessary to edit resource files and compile Notepad3:

  • Visual Studio (or compatible C++ build tools): Notepad3 is written in C++ and uses Windows resource files. To compile the project, you must have Visual Studio 2019/2022 (with C++ support) or MSVC build tools installed.
  • Text Editor with Unicode support: Use an editor that can handle UTF-8 encoding without corrupting characters. Notepad3 is recommended for editing the translation text (Make sure to set the file encoding to Unicode/UTF-8 in Notepad3: File → Encoding → UTF-8​.) This prevents issues with non-ASCII characters.

Basic Knowledge of Windows Resource Files – The UI strings in Notepad3 are stored in .rc resource scripts (not in a simple text JSON or PO file). You should be comfortable editing .rc files (which look like blocks of dialog definitions, string tables, menus, etc.). No deep programming is needed, but be careful not to alter the structure of these files; only the quoted texts need translation.

Language Expertise – You should have a good command of the target language to provide accurate translations. Consistency and proper terminology matter in a technical UI.

Adding MUI Language (Example: Italian)

Follow these steps to add a new language to Notepad3’s MUI system. This example will illustrate the process by adding Italian (it-IT) support. The process applies to other languages (substituting the appropriate language code and translations).

Step 1: Fork and Clone the Notepad3 Repository

Begin by forking the Notepad3 GitHub repository to your GitHub account (if you intend to submit your changes). Then, clone your fork to your local machine. You can alternatively clone the main repo directly if you’re testing locally. For example, using the Git command line:

git clone https://github.com/yourusername/Notepad3.git

This will download the entire Notepad3 source, including the language files. In the repository, notice a language folder containing subfolders for each existing translation (e.g., np3_de_de for German, np3_fr_fr for French, etc.), which will serve as references. Notepad3’s maintainers actively welcome new translations – in fact, they often look for volunteers to resume incomplete ones (e.g. Greek or Hindi)​, so your contribution is appreciated.

Step 2: Create a New Language Folder

Inside the Notepad3/language directory, create a folder for your new language using the proper naming convention. The folder name should be np3_<language>_<region>, all in lowercase. Typically, this corresponds to the two-letter language code and two-letter country code (locale) of the language you’re adding​. For example:

  • Italian (Italy) becomes np3_it_it (language code it for Italian, region code IT for Italy).
  • Dutch (Netherlands) would be np3_nl_nl (nl = Dutch, NL = Netherlands).
  • If a language has multiple regional variants (e.g., Portuguese Portugal pt-PT vs Portuguese Brazil pt-BR), choose the standard one or the one you intend to support. (Notepad3 prefers a single variant if possible – e.g., they removed the es-MX in favor of es-ES for Spanish ​to avoid maintaining duplicates.)

Tip: To create the new folder, copy an existing language’s folder as a starting template. A good choice is copying the np3_en_us folder (English US) because it contains the up-to-date original strings in English (the internal default UI text)​. Copy np3_en_us, rename the copy to your target (e.g. np3_it_it), and then proceed to adjust its contents.

Step 3: Rename and Include the Language Resource Files

In your new np3_it_it folder, you should have several files copied from English (or whichever template you used). Typically, the files include:

dialogs_it_it.rcDialog box definitions and their text labels.
menu_it_it.rcMenu definitions (menu bar, context menus, etc.).
lexer_it_it.rcSyntax lexer-related strings (if any, e.g., for language names in the status bar).
encode_it_it.rcCharacter encoding names or related strings.
np3_it_it.rcMaster resource script for this language (often includes or references the others).
np3_it_it.cpp and dllmain.cppSource code files to build the resource DLL (usually, you don’t need to modify the code; these are primarily boilerplate for the DLL).

Update the file names:

Ensure each file has the correct new language code in its name (they should already if you copied and renamed the folder). For example, change dialogs_en_us.rc to dialogs_it_it.rc which should have been done by copying the folder. Also, open each .rc file and verify that it references the new name if needed (some resource scripts might include others – e.g., np3_it_it.rc they might have lines to include dialogs_it_it.rc, etc., which should already be consistent if you copied from English, but double-check).

Add to build (if required):

Notepad3’s build system should detect and compile all language resource files into separate MUI DLLs. If using Visual Studio, you may need to add the new .rc files to the project or solution. For instance, if there is a Visual Studio project for languages, include the np3_it_it.rc and associated files in that project. In many cases, simply having the files in the folder is enough (the build might be scripted to compile all np3_* sub-directories). Refer to how other languages are set up; you can mirror the project settings of an existing language like French. (If you’re unsure, build the solution after adding files – if the Italian resources compile into a np3_it_it.dll, you’ve set it up correctly.)

Next, set the language identifier inside the resource: Open the main resource script file for the new language (e.g. open np3_it_it.rc in a text editor). At the top, you will find a line that defines the language for the resource compiler. For example, the Polish file looks like this:

LANGUAGE LANG_POLISH, SUBLANG_POLISH_POLAND 
#pragma code_page(65001) // UTF-8

Change this to the appropriate constants for your language. For Italian, use:

LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN_ITALY
#pragma code_page(65001)

This ensures Windows knows these resources are in the Italian locale. (For Dutch: LANG_DUTCH, SUBLANG_DUTCH_NETHERLANDS, etc. Most common language constants are available; you can find the correct LANG_... and SUBLANG_... values in the Windows SDK or by referencing another project’s resource file for that language.) The #pragma code_page(65001) line should be left as UTF-8 to allow Unicode characters in the file.

Step 4: Translate the Strings in the Resource Files

This step will be the most time-consuming: replacing the English text with your target language text throughout the resource scripts. Work systematically through each file (dialogs, menus, etc.). Here are some guidelines and tips:

Only translate the text, not the identifiers or syntax:

Each line typically has an identifier or control definition, followed by a quoted string. For example, a menu resource might contain:

POPUP "&File" 
BEGIN
    MENUITEM "E&xit\tAlt+F4",    IDM_EXIT
END

You would translate the words “File” and “Exit” in Italian but leave the structure and IDs intact. For instance:

POPUP "&File"                      -> POPUP "&File" (Translate if applicable)
    MENUITEM "E&xit\tAlt+F4", ...   -> MENUITEM "&Esci\tAlt+F4", IDM_EXIT

Here, “Exit” became “Esci”. Notice that the \tAlt+F4 (which indicates the shortcut) remains and the IDM_EXIT command ID stays unchanged. Translate the human-readable part only. In many cases, the English word “File” as a menu might be translated (e.g., French “Fichier”, Italian could use “File” or “Documento” depending on convention; Dutch “&Bestand”​ etc.). Keep the ampersand & in front of a letter to denote a keyboard shortcut for that menu – you can choose a logical mnemonic in the new language, usually the first letter if available.

Dialog controls:

For dialog boxes (in dialogs_it_it.rc), you will see definitions of buttons, checkboxes, labels, etc., each with a caption string. Translate those captions. E.g.:

LTEXT "Find What:", IDC_FIND_LABEL, 10,10,50,12

might become (in Italian):

LTEXT "Trova:", IDC_FIND_LABEL, 10,10,50,12

Ensure the translated text isn’t too long to fit the specified control width. You may need to adjust the numeric width (and maybe reposition) if your text is longer. Try to keep dialogs visually balanced.

Tip: You can use Visual Studio’s Resource Editor to visually adjust dialog layouts or roughly estimate based on character count. Notepad3’s team often scales dialogs for different locales, so making minor size tweaks for your language is acceptable.

String tables and other resources:

In some cases, there may be STRINGTABLE sections or other miscellaneous strings (e.g. status bar messages, tooltips, etc., in the resource files). Translate those as well. For example, if there’s a string IDS_LOADING = "Loading file...", translate the “Loading file…” part. Leave any % placeholders intact (more on this below).

Do NOT translate or alter special placeholders or variables:

This is critical. Often, strings contain placeholders like %s, %d, {} or newline codes (\n, \r\n). Do not remove or change these placeholders – they are replaced at runtime with dynamic content. For example, a message might be "Saved %d lines to %s". In translation, you must keep %d and %s exactly as is (just reordering if absolutely needed for grammar). Similarly, do not translate anything in curly braces %{...} if it appears – those denote programmatic variables​. Never add extra spaces or characters inside the placeholder sequences​. Changing “File %s not found” to “File % s not found” (with an extra space) would break functionality. Translate the surrounding words but not the format codes. If the sentence structure in your language needs a different order, you might have to live with the English order unless you coordinate a code change – in most cases, it’s fine as is.

Maintain newline and tab symbols:

If you see \n (newline) or \t (tab) in the strings, keep them in the translated string at appropriate places​. They ensure that formatting (line breaks, keyboard shortcuts) remains correct. For instance, "Line 1\nLine 2" should be translated into a form that still has a \n between the equivalent of “Line 1” and “Line 2” in your language.

Preserve keyboard accelerators (ampersands &):

In menus and dialog button labels, & before a character means that character becomes a keyboard shortcut (underlined when Alt is pressed). In your translation, put & before the appropriate letter (usually one of the first letters of the word, that doesn’t conflict with other accelerators in the same menu/dialog). For example, English “&Open” (O underlined) might be Italian “&Apri” (A underlined). Avoid duplicating accelerators that are used in the same context – try to choose unique letters if possible.

Don’t translate product names or trademarks:

The name “Notepad3” should generally remain as is (it’s a proper name). If you see references to Windows or other product names, those usually remain in English or their official localized name. Also, some technical terms or regex syntax etc. might not be translated – use your judgment or see how other languages handled it.

As you translate, save the files in UTF-8 encoding. If using Notepad3, double-check the status bar or Encoding menu says “UTF-8” for each file. This will ensure characters like Ă©, ö, æŒąć­—, etc., are preserved correctly in the source. All .rc files should include the UTF-8 code page pragma (65001) as noted, which allows the compiler to read them correctly.

Step 5: Compile and Test Your New Language

Once translation is done (or you have an initial version), it’s time to build Notepad3 and see your new language in action:

Build the project:

Open the Notepad3 solution in Visual Studio (or use the appropriate build script). Compile the Multilingual version of Notepad3, which should produce the main Notepad3.exe and a set of language DLLs (one for each np3_xx_xx folder). If everything is set up properly, you should get an output file like np3_it_it.dll (the Italian MUI DLL) along with others. If using Visual Studio, make sure the configuration is set to the normal release/debug build (not the “Mono-language” build – Notepad3 has a switch for building a single-language binary without MUI​, which you do not want here). After a successful compile, install or place the new Notepad3 binary and the language DLL in the same folder (if you’re testing with a portable build, the .dll files might reside in a “lang” or directly alongside the exe; in the installer, they go into the program folder).

Select the new language in Notepad3

By default, Notepad3 will use the OS locale to choose the UI language if a translation is available. Otherwise, it falls back to English (en-US)​. To test your new language, you have a couple of options:

Change your system locale

Change your system locale to the new language (if you have Italian as a Windows display language and your Notepad3 build has Italian, it should automatically show in Italian UI). This is a bit heavy-handed for testing.

Use the Notepad3.ini override:

The easier method is to force Notepad3 to use a specific UI language via the settings file. Open Notepad3’s settings (Notepad3.ini). Under the [Settings2] section, find or add the key PreferredLanguageLocaleName. Set it to your new language’s locale code. For example:

[Settings2]
PreferredLanguageLocaleName=it-IT

Save the .ini and (re)start Notepad3. The UI should now load in Italian (it-IT) if the np3_it_it resources are properly installed​. (For Dutch, use nl-NL, etc. The format is language-region with a hyphen, in Title Case as shown in the Notepad3 documentation​). If this setting is not present or left as “en-US”, Notepad3 uses the system language​. Setting it explicitly ensures your translation is loaded for testing.

Verify the UI:

Go through the menus and dialogs in Notepad3 to see if all your translated strings appear correctly. Check for cut-off text, overlaps, or any English strings that you might have missed. It’s common to iterate a bit here – you might discover that some text is too long and needs abbreviating or that you missed a string in a secondary resource file. Also, check special cases: e.g., open the “About” dialog to see if any text there needs translation, or confirm error messages appear in your language by triggering some (like searching for a string not found, etc.). Untranslated or missing strings will typically appear in English (since English is the fallback) – that’s a clue to go back and translate those. If something is not showing in the new language even though you translated it, ensure that resource is indeed being pulled from the MUI DLL and not hard-coded (if it’s hard-coded in the exe, you may need developer help to externalize it; however, most UI text in Notepad3 is already in the resource files).

Troubleshoot issues

If your language doesn’t show up, double-check the naming and placement of files. The DLL should be named and located correctly. For example, Notepad3 might expect language DLLs in a subfolder named Lng or directly next to the EXE. Verify by looking at how other language files are distributed in the official version (for the portable version, all np3_xx_xx.dll files should be in the same directory as Notepad3.exe​). Also, ensure you compiled the multilanguage build. If Notepad3 still refuses to show your language, check the log (if any) or output – it might default to English if it can’t find the locale. Setting PreferredLanguageLocaleName as above usually forces it, so if even that doesn’t work, there might be a mismatch in the locale name: for instance, if you accidentally set LANG_ITALIAN, SUBLANG_ITALIAN_SWISS (just an example) but are trying to load it-IT, it might not consider it a match. The locale of the resource DLL needs to match the code you’re requesting. Using the standard pairing (Italy for Italian, Netherlands for Dutch, etc.) avoids this issue.

Step 6: Contribute Your Translation Back

Once you have a working translation, it’s time to share it to be included in official Notepad3 releases. There are a few ways to do this:

Submit a Pull Request on GitHub:

This is the preferred method for developers. Commit your new language files to your fork of the Notepad3 repository. Be sure to include all new files and any project/solution changes required to build them. Push the commits to your fork and open a Pull Request against the official rizonesoft/Notepad3 repository on GitHub. In the PR description, mention that you are adding a new language and note if it’s complete or if you need any review. The maintainers are usually quite welcoming to translation contributions – they have explicitly invited volunteers to help with new languages​. Once the PR is reviewed and merged, your language will become part of Notepad3’s codebase.

Troubleshooting Common Problems

Garbled or “???“ Characters Appear:

This almost always traces to an encoding problem. If accented or non-Latin characters appear as ??? or gibberish in the UI, check that your .rc files were saved in UTF-8. All Notepad3 language files must be in Unicode format​. To fix it, open the file in Notepad3, go to the Encoding menu, choose UTF-8, and then save. Also, ensure that #pragma code_page(65001) is at the top of the .rc (which it should be). Recompile and test again. This should resolve any character corruption.

Translation Not Showing Up in UI

If Notepad3 still displays in English after adding your new language:

  • Make sure you set PreferredLanguageLocaleName correctly in the INI and restarted the app​. It should match the language code of your resource (e.g., “it-IT”). Check the Notepad3 About dialog or log to see what UI language it thinks it’s using.
  • Verify that the compiled language DLL is indeed being loaded. The DLL filename should correspond to your folder name (e.g., np3_it_it.dll). If you suspect it’s not loading, one trick is temporarily removing other language files – if Notepad3 only finds Italian as an option, it should either load it or complain.
  • Confirm that your build includes the new language. If you don’t see a np3_it_it.dll in your output, the project might not have compiled it. Revisit step 3 about adding it to the build configuration.
  • If your language still won’t engage, double-check the LANGUAGE line in the .rc. Using a non-standard sublanguage could cause a mismatch. Typically, use the primary country variant (e.g., SUBLANG_ITALIAN_ITALY for Italian). Rarely does an OS use a different neutral tag, but since we force it via INI, it should match.

Build Errors in Resource Compilation

If the resource compiler throws errors, read the message carefully. Common mistakes include:

  • Missing quotes or commas in .rc files (syntax errors). Ensure any quotes in your translated text are properly escaped or paired. For example, to include a quote mark in the UI text, you’d do \". An unmatched quote will break the .rc file.
  • Using an undefined LANG or SUBLANG constant. If you tried to use a language constant that the resource compiler doesn’t recognize, it will cause an error. Use standard ones from Windows SDK (most common languages are supported). For instance, using LANG_SPANISH, SUBLANG_SPANISH_ARGENTINA might fail if that sublang isn’t defined; Notepad3 uses es-ES (Spain) as the baseline. Stick to known combinations as seen in other Notepad3 languages or Microsoft docs.
  • If you see errors about duplicate resource IDs, you may have a conflict or have included the same resource twice. Ensure your np3_it_it.rc isn’t including the English resources by accident. It should include the Italian ones only. Also, ensure each XXX_it_it.rc file has unique content and is referenced once.

Layout Issues (Clipped Text)

After testing, you might notice some translated text doesn’t fit in the UI elements (e.g., a button text cut off). This is common due to differing word lengths. To fix this, you can increase the control width in the .rc dialogs. For example, if a static text control was 50 units wide for an English word, and your translated phrase is longer, try bumping it to 70. Keep the dialog symmetry in mind. If a dialog becomes too wide or tall, that might be okay within reason, but test on different DPI settings if possible (Notepad3 adjusts dialogs for scaling​). Another strategy is to find a shorter synonym, if possible, or an abbreviation that users would understand. Consistency with other translations can guide you (see how German or French, which often have long words, handled that dialog).

Hotkey Conflicts

If a menu or dialog has multiple items with the same accelerator key (e.g., two different buttons showing an underlined “F” in their labels), you should change one. Edit the & placement in one of the labels to use a different letter. There’s no harm in using a different letter as long as it’s intuitive enough. This is a minor issue, but polishing it improves usability.

Dynamic Content Not Translated

Some UI parts might not be in the resource files at all. For example, content in the Status Bar (like the line/column display) or certain error messages could be formatted in code. If you encounter English text in the UI that you cannot find in any of the resource .rc files, it might be built in programmatically. Check the Notepad3 source (Notepad3/src/ C files) for that text; if it’s hard-coded, you might need to request the maintainers to externalize it so it can be translated. Currently, most user-facing strings are already in the MUI resources, but keep an eye out for any that aren’t.

Ensure Unicode Characters Render

If your language uses a non-Latin script (e.g., Chinese, Hindi, Russian), verify that the font Notepad3 uses for menus/dialogs supports those characters. Notepad3 uses the system default UI font, which will handle most scripts on modern Windows. Just confirm that characters aren’t showing as squares or question marks. If they do, it’s likely an encoding issue rather than a font issue since Windows UI fonts cover a wide range. Double-check your file encoding and resource script settings.

Maintaining Translation Files Across Updates

Translating Notepad3 is not a one-and-done task – you’ll want to maintain it as the software evolves. Here are final notes on keeping your language support up-to-date:

Stay Updated with New Strings

The Notepad3 project actively develops new features, and with new features come new UI strings that need translation. Keep an eye on the Notepad3 release notes and commit history. The developers often tag new or changed strings with a NLS marker (“New Language Strings”) in commit messages or changelogs​. For example, if a release note says NLS: Added "XYZ" feature string, that’s a cue that you should add a translation for “XYZ” in your language file. A good practice is to periodically diff your English template (np3_en_us) with your language to spot new entries. They also provide “Line numbers to translate” text files​ , which might list strings that need translation. Check if this exists or if there are updates for your version.

Sync with Base English Resources

When a new version of Notepad3 is released, grab the updated np3_en_us resource files and compare them against your translation. You can use a text diff tool to identify what changed (new menu items, renamed commands, etc.). Add translations for new lines and adjust or remove any strings that were changed/removed in English accordingly. Doing this sooner rather than later prevents your translation from lagging behind. If you contributed via Git, you can also pull the latest changes from the main repository, merge them into your fork, and then update your language files.

Conclusion

By following this guide, you should be able to successfully add a new language to Notepad3’s MUI system and see the application fully localized in that language. This benefits speakers of that language and contributes to the Notepad3 project’s goal of broad accessibility. Good luck with your translation, and thank you for helping make Notepad3 better for everyone!