Refactor to use _val for translation handling across components

This commit is contained in:
Stela Augustinova
2025-11-07 14:40:52 +01:00
parent bda5c4f5dd
commit e694aca70b
7 changed files with 21 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import invalidateCommands from '../commands/invalidateCommands';
import { runGroupCommand } from '../commands/runCommand';
import { currentDropDownMenu, visibleCommandPalette } from '../stores';
import getAsArray from './getAsArray';
import { _val } from '../translations';
let isContextMenuSupressed = false;
@@ -114,7 +115,7 @@ function mapItem(item, commands) {
if (command) {
const commandText = item.text || command.menuName || command.toolbarName || command.name;
return {
text: _.isFunction(commandText) ? commandText() : commandText,
text: _val(commandText),
keyText: command.keyText || command.keyTextFromGroup || command.disableHandleKeyText,
onClick: () => {
if (command.isGroupCommand) {