{"id":30870560,"url":"https://github.com/molsonkiko/nppcsharppluginpack","last_synced_at":"2025-09-07T22:23:14.435Z","repository":{"id":217085928,"uuid":"743057582","full_name":"molsonkiko/NppCSharpPluginPack","owner":"molsonkiko","description":"A template for making Notepad++ plugins in C#","archived":false,"fork":false,"pushed_at":"2025-08-19T17:33:35.000Z","size":2616,"stargazers_count":22,"open_issues_count":3,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-01T11:27:22.858Z","etag":null,"topics":["notepad-plusplus-plugin"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/molsonkiko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-14T07:26:38.000Z","updated_at":"2025-08-19T17:33:32.000Z","dependencies_parsed_at":"2024-06-24T00:23:35.010Z","dependency_job_id":"f827683e-a325-4923-ba68-5db117aa4a76","html_url":"https://github.com/molsonkiko/NppCSharpPluginPack","commit_stats":null,"previous_names":["molsonkiko/nppcsharppluginpack"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/molsonkiko/NppCSharpPluginPack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molsonkiko%2FNppCSharpPluginPack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molsonkiko%2FNppCSharpPluginPack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molsonkiko%2FNppCSharpPluginPack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molsonkiko%2FNppCSharpPluginPack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/molsonkiko","download_url":"https://codeload.github.com/molsonkiko/NppCSharpPluginPack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molsonkiko%2FNppCSharpPluginPack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274104726,"owners_count":25223070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notepad-plusplus-plugin"],"created_at":"2025-09-07T22:04:43.482Z","updated_at":"2025-09-07T22:23:14.420Z","avatar_url":"https://github.com/molsonkiko.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NppCSharpPluginPack\r\n\r\n[![Continuous Integration](https://github.com/molsonkiko/NppCSharpPluginPack/actions/workflows/CI_build.yml/badge.svg)](https://github.com/molsonkiko/NppCSharpPluginPack/actions/workflows/CI_build.yml)\r\n\r\n[![License](http://img.shields.io/badge/License-Apache_2-red.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)\r\n\r\nThis is a template for Notepad++ plugins written in C#. The vast majority of the code (certainly all the parts that were really hard to implement) come from [kbilsted's now-archived `NotepadPlusPlusPluginPack.Net`](https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net), with some significant changes, including:\r\n\r\n1. A simpler architecture in which the [PluginInfrastructure folder](/NppCSharpPluginPack/PluginInfrastructure/) is side-by-side with the rest of the plugin's code, rather than in a separate directory tree.\r\n2. An example of a [non-docking (pop-up) dialog](/docs/README.md#about-form) opened from the plugin menu, a [docking form](/docs/README.md#selections-remembering-form), and a [non-docking non-pop-up form](/docs/README.md#dark-mode-test-form).\r\n3. A [settings form](/docs/README.md#settings-form) that makes it easy for the maintainer to add, remove or edit settings.\r\n4. A template for [automated tests](/docs/README.md#running-tests) that can be run inside Notepad++, including a template for user interface tests that automatically test forms.\r\n\r\nIf you have any issues, see if [updating to the latest release](https://github.com/molsonkiko/NppCSharpPluginPack/releases) helps, and then feel free to raise an [issue](https://github.com/molsonkiko/NppCSharpPluginPack/issues) on GitHub. Please be sure to include diagnostic information about your system, Notepad++ version, and plugin version (go to `?-\u003eDebug Info...` from the Notepad++ main menu).\r\n\r\n[Read the docs.](/docs/README.md)\r\n\r\n[Read information about the plugin architecture (*some of this may be out of date*)](/PluginPackArchitecture.md)\r\n\r\n[View past changes.](/CHANGELOG.md)\r\n\r\n## Using the template ##\r\n\r\n1. Download the source code in one of the following ways:\r\n    - clone the repository\r\n    - download the source code for the repo, then create a git repo inside\r\n    - fork this repo\r\n    - download the source code for a release (see the [Releases page](https://github.com/molsonkiko/NppCSharpPluginPack/releases))\r\n2. Open [NppCSharpPluginPack/NppCSharpPluginPack.sln](https://github.com/molsonkiko/NppCSharpPluginPack/blob/main/NppCSharpPluginPack/NppCSharpPluginPack.sln) in Visual Studio 2022\r\n3. Configure the security settings of `%ProgramFiles%/Notepad++/plugins` so that Visual Studio can write to `%ProgramFiles%/Notepad++/plugins/CSharpPluginPack`. I do this in the following way:\r\n    1. Open `%ProgramFiles%/Notepad++` in the File Explorer.\r\n    2. Right-click on the `plugins` folder.\r\n    3. Choose `Properties` from the drop-down menu\r\n    4. Select the `Security` tab.\r\n    5. Click the `Edit...` checkbox\r\n    6. Select `Users` from the `Group or user names` menu, then click the checkbox in the `Full Control` row of the `Allow` column.\r\n    7. Click the `Apply` button.\r\n4. Try building the project using Visual Studio using `x64` build target (this build for 64-bit Notepad++). You will know that the project is working correctly when Notepad++ starts up, and `CSharpPluginPack` appears on the list of plugins.\r\n5. Try changing the assembly version in [NppCSharpPluginPack/Properties/AssemblyInfo.cs](https://github.com/molsonkiko/NppCSharpPluginPack/blob/main/NppCSharpPluginPack/Properties/AssemblyInfo.cs) to `1.0.3.0`.\r\n6. Try building the project again, then select `Plugins-\u003eCSharpPluginPack-\u003eAbout` from the Notepad++ dropdown menu. The title of the [about form](/docs/README.md#about-form) should read `NppCSharpPluginPack v1.0.3`. If it does not, your project is not building correctly.\r\n7. Copy the `testfiles` directory of the repo to the `%ProgramFiles%/Notepad++/plugins/CSharpPluginPack` directory. *Note: this step is __not necessary__ starting in v0.0.3.20, because that is the first version that automatically syncs the `testfiles` directory in the repo with the `testfiles` directory in the directory targeted by the build process.*\r\n8. Run the tests. The third line of the test results file should read `No tests failed`. If you see `Tests failed: Performance of something` on the third line, that's because you forgot step 7.\r\n9. To test your project for 32-bit Notepad++, repeat steps 3-8 for `%ProgramFiles (x86)%/Notepad++/plugins` and change your build target to `x86`.\r\n\r\n## System Requirements ##\r\n\r\nThis plugin is verified to work on versions of Notepad++ as old as [v7.3.3](https://notepad-plus-plus.org/downloads/v7.3.3/), but it may have some bugs ([see the CHANGELOG](/CHANGELOG.md) to see the what bugs may still exist).\r\n\r\nIt has also been tested and verified to work normally on the newest versions of Notepad++, [v8.8.1](https://notepad-plus-plus.org/downloads/v8.8.1/).\r\n\r\nEvery version of the template works on [Windows 10 May 2019 update](https://blogs.windows.com/windowsexperience/2019/05/21/how-to-get-the-windows-10-may-2019-update/) or later, or you must install [.NET Framework 4.8](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48).\r\n\r\n## Translating your plugin to another language ##\r\n\r\nIf you are interested in helping users of your plugin who don't speak English, this plugin pack makes it easy to translate your plugin to other languages beginning in [v0.0.3.7](/CHANGELOG.md#004---unreleased-yyyy-mm-dd).\r\n\r\n[`Translator.cs`](https://github.com/molsonkiko/NppCSharpPluginPack/blob/main/NppCSharpPluginPack/Utils/Translator.cs) infers your preferred language and attempts to translate in the following way:\r\n1. It first attempts to use [NPPM_GETNATIVELANGFILENAME](https://npp-user-manual.org/docs/plugin-communication/#2140nppm_getnativelangfilename) (introduced in Notepad++ 8.7) to get the name of the Notepad++ UI language.\r\n2. If step 1 fails, it checks your [Notepad++ `nativeLang.xml` config file](https://npp-user-manual.org/docs/binary-translation/#creating-or-editing-a-translation) (at [XPath path](https://www.w3schools.com/xml/xml_xpath.asp) `/NotepadPlus/Native-Langue/@name`) to determine what language you prefer to use, and sets `lowerEnglishName` to the appropriate value and __skips to step 3__. For example, if this file says `galician`, we will attempt to translate your plugin to `galician`. __If the Notepad++ native language is `english` *or* if your plugin does not have a translation file for the Notepad++ native language, `Translator.cs` then does the following:__\r\n3. If steps 1 and 2 fail and the `CHECK_WINDOWS_CULTURE` flag is set to `true` (it is `false` by default), `Translator.cs` looks up your [`current culture`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-culture?view=powershell-7.4) (which can be checked using the `get-culture` command in Powershell).\r\n    * Next, we find the `EnglishName` property of the `current culture` (which can be found by the `$foo = get-culture; $foo.EnglishName` command in Powershell), take the first word, and convert it to lowercase, and set `lowerEnglishName` to this.\r\n        - Example: the `EnglishName` of the `en-us` culture is `English (United States)`, so `lowerEnglishName` is `english`\r\n        - Example: the `EnglishName` of the `it-it` culture is `Italian (Italy)`, so `lowerEnglishName` is `italian`\r\n4. `Translator.cs` then does one of the following:\r\n    - If `lowerEnglishName` is `english`, it does nothing (because the plugin is naturally in English)\r\n    - Otherwise, it looks in the `translation` subdirectory of the `CSharpPluginPack` plugin folder (where `CSharpPluginPack.dll` lives) for a file named `{lowerEnglishName}.json5`\r\n    - __NOTE:__ because the translation files are in a subdirectory of the plugin folder, *translation does not work for versions of Notepad++ older than [version 8](https://notepad-plus-plus.org/downloads/v8/),* since those older versions do not have separate folders for each plugin.\r\n5. If `Translator.cs` found `translation\\{lowerEnglishName}.json5`, it attempts to parse the file. If parsing fails, a message box will appear warning the user of this.\r\n    - If no translation file was found, or if parsing failed, the default English will be used.\r\n6. If parsing was successful, `Translator.cs` will use the translation file as described below.\r\n\r\nWhen the user changes their Notepad++ UI language, the plugin will respond to this change as follows (according to the version number of NppCSharpPluginPack):\r\n\r\n| CSharpPluginPack version | Translation at startup | Translation *possible* (but slow) as soon as user changes their preference | Translation *guaranteed* when user changes their preference |\r\n|--------------------------|------------------------|----------------------------------------------------------------------------|-------------------------------------------------------------|\r\n|  v0.0.3.7 to 0.0.3.10    |   __YES__              |   __NO__                                                                   |                   __NO__                                    |\r\n|  v0.0.3.11               |   __YES__              |   __YES__                                                                  |                   __NO__                                    |\r\n|  v0.0.3.14 or higher     |   __YES__              |   __YES__                                                                  |   __YES__ (only for Notepad++ 8.7 or higher)                |\r\n\r\nTo translate your plugin to another language, just look at [`english.json5` in the translations directory of this repo](https://github.com/molsonkiko/NppCSharpPluginPack/blob/main/translation/english.json5) and follow the instructions in that file.\r\n\r\nCurrently NppCSharpPluginPack has been translated into the following languages:\r\n| Language | First version with translation | Translator(s) | Translator is native speaker?  |\r\n|----------|--------------------------------|---------------|--------------------------------|\r\n| [Spanish](https://github.com/molsonkiko/NppCSharpPluginPack/blob/main/translation/spanish.json5)  |   [v3.7](https://github.com/molsonkiko/NppCSharpPluginPack/commit/cc93a081e1fc1de3c10a953bb0d1ac035326b19e) |  [molsonkiko](https://github.com/molsonkiko)  |  __NO__ |\r\n\r\n\r\nThe following aspects of NppCSharpPluginPack __can__ be translated:\r\n- Forms (including all controls and items in drop-down menus) (see the `TranslateForm` method in `Translator.cs`)\r\n- Items in the NppCSharpPluginPack sub-menu of the Notepad++ Plugins menu (see the `GetTranslatedMenuItem` method in `Translator.cs`)\r\n- The descriptions of settings in the [`CSharpPluginPack.ini` config file and settings form](/docs/README.md#settings-form) (see the `TranslateSettingsDescription` method in `Translator.cs`)\r\n- Message boxes (includes warnings, errors, requests for confirmation) (see the `ShowTranslatedMessageBox` method in `Translator.cs`)\r\n\r\nThe following aspects of NppCSharpPluginPack __may eventually__ be translated:\r\n- This documentation\r\n- The messages of user-defined exceptions (for example, if your plugin `FooHasNoBarException`, there is currently no way to translate the message that the user sees when this error is thrown and caught)\r\n- Generic modal dialogs (for example, file-opening dialogs, directory selection dialogs)\r\n\r\n## Acknowledgments ##\r\n\r\n* [Kasper B. Graversen](https://github.com/kbilsted) for creating the [plugin pack](https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net) that this is based on.\r\n* [jokedst](https://github.com/jokedst) for making the [CsvQuery plugin](https://github.com/jokedst/CsvQuery) to which I owe the original ideas behind my settings form and my adaptive styling of forms.\r\n* And of course, Don Ho for creating [Notepad++](https://notepad-plus-plus.org/)!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolsonkiko%2Fnppcsharppluginpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmolsonkiko%2Fnppcsharppluginpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolsonkiko%2Fnppcsharppluginpack/lists"}