TranslateID (FolderName) in UserDefinedCommands (shortcuts.xml)
-
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)" && 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)" && pause</Command> <Command name="Open folder" FolderName="" TranslateID="common-cancel" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k cd /d "$(CURRENT_DIRECTORY)" && 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 displayedFolderName
.