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
. -
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
.If you look again at the reference you linked, the TranslateID attribute is defined for the
contextMenu.xml
; however, the<Command>
tags in theshortcuts.xml
do not have that attribute listed as being available.Thus, I do not believe what you are looking for is currently possible. Thus, I think you would have to follow the instructions in our FAQ to put in a feature request to ask the developer to add TranslateID to the
shortcuts.xml
<Command>
tag. -
@PeterJones said in TranslateID (FolderName) in UserDefinedCommands (shortcuts.xml):
If you look again at the reference you linked, the TranslateID attribute is defined for the
contextMenu.xml
; however, the<Command>
tags in theshortcuts.xml
do not have that attribute listed as being available.Thus, I do not believe what you are looking for is currently possible. Thus, I think you would have to follow the instructions in our FAQ to put in a feature request to ask the developer to add TranslateID to the
shortcuts.xml
<Command>
tag.Hello, @PeterJones.
I truly appreciate your quick response and such a clear explanation!
Indeed, upon rereading the documentation I referenced, I realized I misunderstood the use of the
TranslateID
attribute. It applies tocontextMenu.xml
, notshortcuts.xml
, as I had mistakenly assumed. That was an oversight on my part, and I appreciate you pointing it out so objectively.In my case, this was just curiosity based on that mistaken understanding. It’s not something essential for daily use of the application. I’m glad to have learned the actual scope of this functionality.
Thanks again for your kindness and clarification.