Disable menu activation for a shortcut not working for english.xml
-
In the directory C:\OFFICE\Notepad++\localization I’ve edited the file english.xml to remove
x
from being used to exit the program:Before:
<Item id="41011" name="E&xit"/>
After:
<Item id="41011" name="Exit"/>
However after saving and restarted pressing
x
still results in Notepad++ exiting. I’m posting while using 8.7.5 and I’ll do an update to see if it’s been fixed (likely not). I avoid updates as sometimes it introduces non-desirable changes or additions and I really need a stable work environment. -
x
only exits Notepad++ if you have the File menu open. Do you really accidentally typex
that often when the File menu is open?And
english.xml
is only read if you change your language to something else, then change it back to English. Whenever you change languages, it creates or overwrites%AppData%\Notepad++\nativeLang.xml
(or equivalent, depending on your active settings location) from the source language XML; ifnativeLang.xml
doesn’t exist, it actually uses the defaults compiled into the Notepad++ executable, not the values inenglish.xml
.Further, the “English” is special, which is why there’s an English (customizable) entry (
english_customizable.xml
): if it readsnativeLang.xml
and sees<Native-Langue name="English" filename="english.xml" version="8.8.1">
when it initially loads, it doesn’t seem to use those, but instead uses the default values in the app (as far as my experiments just now show), because I changed to English (customizable), then editedenglish.xml
to have<Item id="41011" name="EnglishExit"/>
, then set Localization back to English, and it appeared to change to EnglishExit in the File menu, and didn’t respond tox
when the menu was open. But when I exited Notepad++ and restarted, and confirmed thatnativeLang.xml
still whowed EnglishExit, the menu is back to the normal Exit entry, wherex
is the Windows menu accelerator again. To reiterate: The main English is special, so that’s why Notepad++ provides English (customizable) for being able to customize your English menu entries. (This is described in the user manual, here.)If I change
english_customizable.xml
to use<Item id="41011" name="MyExeunt"/>
, switch Localization to English (customizable), exit, and restart Notepad++, it still maintains that entry as MyExeunt, with no windows menu accelerator active for that command. (The same happens if I have<Item id="41011" name="Exit"/>
when I start with English (customizable). Please note if you run the first experiment, then editenglish_customizable.xml
, you will have to pick a different localization, then re-pick English (customizable), to get Notepad++ to copy the updated settings tonativeLang.xml
.I’ll do an update to see if it’s been fixed (likely not).
In short: it’s not a bug, so there’s nothing to fix.
avoid updates as sometimes it introduces non-desirable changes or additions and I really need a stable work environment.
And in my experience, Notepad++ is usually quite stable for the versions that trigger auto-update. (Usually, instabilities are found in the 1-2 week between releasing the new version and triggering auto-update, and those versions that have instabilities are fixed as quickly as possible and never trigger auto-update.) But you obviously can choose to ignore updates all you want.
-
Just some additional notes…
And english.xml is only read if you change your language to something else, then change it back to English.
This is true for any language, not just English (but, also, see below).
Here’s how most people that care seem to think things work:
- edit
xxx.xml
(wherexxx
is your language of choice) and save the file - restart Notepad++ and expect to see whatever changes you made
IT DOESN’T WORK THIS WAY (although it isn’t unreasonable to expect it to).
Here’s how it actually works:
- edit
xxx.xml
(wherexxx
is your language of choice) and save the file - go to the Settings > Preferences > General area and drop down the Localization box (do this even if what is showing as the active entry is already the language represented by the
xxx.xml
file) - select (or re-select) the language represented by the
xxx.xml
file; any changes that were made in the file take effect instantly, no need to restart N++
- edit
-
@PeterJones said:
if it reads nativeLang.xml and sees <Native-Langue name=“English” filename=“english.xml” version=“8.8.1”> when it initially loads, it doesn’t seem to use those, but instead uses the default values in the app (as far as my experiments just now show)
Yes, I’ve noticed this. And the only way to notice it is because what’s “in the app” and what’s in
english.xml
is slightly different. I suppose I understand, because when you’re designing a UI in an IDE, you caption controls and otherwise assign text labels. But, sinceenglish.xml
should be lock-step with that procedure – and human editing is fallible, the app should never use its design-time text – well, I guess only for the worst-case scenario of no language/localization xml files being present. -
I had to reinstall to get the English Customizable file installed (C:\Notepad++\localization\english_customizable.xml). I made some recommended changes (
name="Exit&°"
), changed to English and then back to English Customizable and tested it and it did not exit as desired; thanks!