Community
    • Login

    TranslateID (FolderName) in UserDefinedCommands (shortcuts.xml)

    Scheduled Pinned Locked Moved General Discussion
    1 Posts 1 Posters 19 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.
    • João MacJ
      João Mac
      last edited by

      I’m using Notepad++ 8.8.1 (Portuguese GUI).

      In the file [notepad++ path]\localization\english.xml, there’s a section called “MiscStrings”, which has the following IDs:

      <common-ok value="OK"/>
      <common-cancel value="Cancel"/>
      <summary value="Summary"/>
      

      I’d like to test the TranslateID attribute for submenus (FolderName) in the file [notepad++ path]\shortcuts.xml, section “UserDefinedCommands”:

      <UserDefinedCommands>
          <Command name="Open CMD" FolderName="Terminal" TranslateID="common-ok" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k</Command>
          <Command name="CMD in current path" FolderName="Terminal" TranslateID="common-ok" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k cd /d "$(CURRENT_DIRECTORY)"</Command>
          <Command name="File info" FolderName="X1" TranslateID="summary" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k echo "Arquivo: $(FILE_NAME)" &amp;&amp; pause</Command>
          <Command name="Full path" FolderName="X1" TranslateID="summary" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k echo "Caminho: $(FULL_CURRENT_PATH)" &amp;&amp; pause</Command>
          <Command name="Open folder" FolderName="" TranslateID="common-cancel" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k cd /d "$(CURRENT_DIRECTORY)" &amp;&amp; dir</Command>
          <Command name="Show files" FolderName="" TranslateID="common-cancel" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k dir "$(CURRENT_DIRECTORY)\*.*" /b</Command>
      </UserDefinedCommands>
      

      After restarting Notepad++, the submenus still appear with the names “Terminal” and “X1” instead of the expected translations “OK” and “Summary”. What should I correct?

      Reference: https://npp-user-manual.org/docs/config-files/

      FolderName attribute: Used for grouping items into sub-menus in the context menu.

      TranslateID attribute: Used for auto-translating your sub-menu names. If the attribute’s value matches one of the nodes in the <MiscStrings> section of english.xml or similar translation files, the menu will use your active translation’s value for the displayed FolderName.

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