Community
    • Login

    Disable menu activation for a shortcut not working for english.xml

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 94 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jabcreationsJ
      jabcreations
      last edited by

      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&amp;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.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @jabcreations
        last edited by PeterJones

        @jabcreations ,

        x only exits Notepad++ if you have the File menu open. Do you really accidentally type x 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; if nativeLang.xml doesn’t exist, it actually uses the defaults compiled into the Notepad++ executable, not the values in english.xml.

        Further, the “English” is special, which is why there’s an English (customizable) entry (english_customizable.xml): 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), because I changed to English (customizable), then edited english.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 to x when the menu was open. But when I exited Notepad++ and restarted, and confirmed that nativeLang.xml still whowed EnglishExit, the menu is back to the normal Exit entry, where x 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 edit english_customizable.xml, you will have to pick a different localization, then re-pick English (customizable), to get Notepad++ to copy the updated settings to nativeLang.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.

        Alan KilbornA jabcreationsJ 3 Replies Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @PeterJones
          last edited by Alan Kilborn

          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 (where xxx 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 (where xxx 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++
          1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @PeterJones
            last edited by

            @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, since english.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.

            1 Reply Last reply Reply Quote 1
            • jabcreationsJ
              jabcreations @PeterJones
              last edited by

              @PeterJones

              I had to reinstall to get the English Customizable file installed (C:\Notepad++\localization\english_customizable.xml). I made some recommended changes (name="Exit&amp;°"), changed to English and then back to English Customizable and tested it and it did not exit as desired; thanks!

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors