Browse Source

Move strings from ModuleWidget and RackWidget to translations file.

tags/v2.6.1
Andrew Belt 5 months ago
parent
commit
5d8effcd75
3 changed files with 112 additions and 56 deletions
  1. +31
    -31
      src/app/ModuleWidget.cpp
  2. +24
    -24
      src/app/RackWidget.cpp
  3. +57
    -1
      translations/en.json

+ 31
- 31
src/app/ModuleWidget.cpp View File

@@ -543,7 +543,7 @@ bool ModuleWidget::pasteJsonAction(json_t* moduleJ) {


// history::ModuleChange // history::ModuleChange
history::ModuleChange* h = new history::ModuleChange; history::ModuleChange* h = new history::ModuleChange;
h->name = "paste module preset";
h->name = string::translate("ModuleWidget.history.pastePreset");
h->moduleId = module->id; h->moduleId = module->id;
json_incref(oldModuleJ); json_incref(oldModuleJ);
h->oldModuleJ = oldModuleJ; h->oldModuleJ = oldModuleJ;
@@ -602,7 +602,7 @@ void ModuleWidget::load(std::string filename) {
void ModuleWidget::loadAction(std::string filename) { void ModuleWidget::loadAction(std::string filename) {
// history::ModuleChange // history::ModuleChange
history::ModuleChange* h = new history::ModuleChange; history::ModuleChange* h = new history::ModuleChange;
h->name = "load module preset";
h->name = string::translate("ModuleWidget.history.loadPreset");
h->moduleId = module->id; h->moduleId = module->id;
h->oldModuleJ = toJson(); h->oldModuleJ = toJson();


@@ -673,7 +673,7 @@ void ModuleWidget::save(std::string filename) {


FILE* file = std::fopen(filename.c_str(), "w"); FILE* file = std::fopen(filename.c_str(), "w");
if (!file) { if (!file) {
std::string message = string::f("Could not save preset to file %s", filename);
std::string message = string::f(string::translate("ModuleWidget.savePresetFailed"), filename);
osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str()); osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str());
return; return;
} }
@@ -691,7 +691,7 @@ void ModuleWidget::saveTemplate() {


void ModuleWidget::saveTemplateDialog() { void ModuleWidget::saveTemplateDialog() {
if (hasTemplate()) { if (hasTemplate()) {
std::string message = string::f("Overwrite default preset for %s?", model->getFullName());
std::string message = string::f(string::translate("ModuleWidget.overwriteTemplate"), model->getFullName());
if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str())) if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str()))
return; return;
} }
@@ -711,7 +711,7 @@ void ModuleWidget::clearTemplate() {
} }


void ModuleWidget::clearTemplateDialog() { void ModuleWidget::clearTemplateDialog() {
std::string message = string::f("Delete default preset for %s?", model->getFullName());
std::string message = string::f(string::translate("ModuleWidget.clearTemplate"), model->getFullName());
if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str())) if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str()))
return; return;
clearTemplate(); clearTemplate();
@@ -761,7 +761,7 @@ void ModuleWidget::resetAction() {


// history::ModuleChange // history::ModuleChange
history::ModuleChange* h = new history::ModuleChange; history::ModuleChange* h = new history::ModuleChange;
h->name = "reset module";
h->name = string::translate("ModuleWidget.history.resetModule");
h->moduleId = module->id; h->moduleId = module->id;
h->oldModuleJ = toJson(); h->oldModuleJ = toJson();


@@ -776,7 +776,7 @@ void ModuleWidget::randomizeAction() {


// history::ModuleChange // history::ModuleChange
history::ModuleChange* h = new history::ModuleChange; history::ModuleChange* h = new history::ModuleChange;
h->name = "randomize module";
h->name = string::translate("ModuleWidget.history.randomizeModule");
h->moduleId = module->id; h->moduleId = module->id;
h->oldModuleJ = toJson(); h->oldModuleJ = toJson();


@@ -802,7 +802,7 @@ void ModuleWidget::appendDisconnectActions(history::ComplexAction* complexAction


void ModuleWidget::disconnectAction() { void ModuleWidget::disconnectAction() {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "disconnect cables";
complexAction->name = string::translate("ModuleWidget.history.disconnectCables");
appendDisconnectActions(complexAction); appendDisconnectActions(complexAction);


if (!complexAction->isEmpty()) if (!complexAction->isEmpty())
@@ -814,7 +814,7 @@ void ModuleWidget::disconnectAction() {
void ModuleWidget::cloneAction(bool cloneCables) { void ModuleWidget::cloneAction(bool cloneCables) {
// history::ComplexAction // history::ComplexAction
history::ComplexAction* h = new history::ComplexAction; history::ComplexAction* h = new history::ComplexAction;
h->name = "duplicate module";
h->name = string::translate("ModuleWidget.history.duplicateModule");


// Save patch store in this module so we can copy it below // Save patch store in this module so we can copy it below
APP->engine->prepareSaveModule(module); APP->engine->prepareSaveModule(module);
@@ -914,7 +914,7 @@ void ModuleWidget::bypassAction(bool bypassed) {
h->moduleId = module->id; h->moduleId = module->id;
h->bypassed = bypassed; h->bypassed = bypassed;
if (!bypassed) if (!bypassed)
h->name = "un-bypass module";
h->name = string::translate("ModuleWidget.history.unbypassModule");
APP->history->push(h); APP->history->push(h);


APP->engine->bypassModule(module, bypassed); APP->engine->bypassModule(module, bypassed);
@@ -922,7 +922,7 @@ void ModuleWidget::bypassAction(bool bypassed) {


void ModuleWidget::removeAction() { void ModuleWidget::removeAction() {
history::ComplexAction* h = new history::ComplexAction; history::ComplexAction* h = new history::ComplexAction;
h->name = "delete module";
h->name = string::translate("ModuleWidget.history.deleteModule");


// Disconnect cables // Disconnect cables
appendDisconnectActions(h); appendDisconnectActions(h);
@@ -987,7 +987,7 @@ static void appendPresetItems(ui::Menu* menu, WeakPtr<ModuleWidget> moduleWidget
} }
} }
if (!hasPresets) { if (!hasPresets) {
menu->addChild(createMenuLabel("(None)"));
menu->addChild(createMenuLabel(string::translate("ModuleWidget.nonePresets")));
} }
}; };


@@ -1003,49 +1003,49 @@ void ModuleWidget::createContextMenu() {
menu->addChild(createMenuLabel(model->plugin->brand)); menu->addChild(createMenuLabel(model->plugin->brand));


// Info // Info
menu->addChild(createSubmenuItem("Info", "", [=](ui::Menu* menu) {
menu->addChild(createSubmenuItem(string::translate("ModuleWidget.info"), "", [=](ui::Menu* menu) {
model->appendContextMenu(menu); model->appendContextMenu(menu);


if (!weakThis) if (!weakThis)
return; return;
menu->addChild(new ui::MenuSeparator); menu->addChild(new ui::MenuSeparator);
menu->addChild(createMenuLabel("Module instance ID:"));
menu->addChild(createMenuLabel(string::translate("ModuleWidget.moduleId")));
menu->addChild(createMenuLabel(string::f("%lld", (long long) weakThis->module->getId()))); menu->addChild(createMenuLabel(string::f("%lld", (long long) weakThis->module->getId())));
})); }));


// Preset // Preset
menu->addChild(createSubmenuItem("Preset", "", [=](ui::Menu* menu) {
menu->addChild(createMenuItem("Copy", widget::getKeyCommandName(GLFW_KEY_C, RACK_MOD_CTRL), [=]() {
menu->addChild(createSubmenuItem(string::translate("ModuleWidget.preset"), "", [=](ui::Menu* menu) {
menu->addChild(createMenuItem(string::translate("ModuleWidget.copy"), widget::getKeyCommandName(GLFW_KEY_C, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->copyClipboard(); weakThis->copyClipboard();
})); }));


menu->addChild(createMenuItem("Paste", widget::getKeyCommandName(GLFW_KEY_V, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.paste"), widget::getKeyCommandName(GLFW_KEY_V, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->pasteClipboardAction(); weakThis->pasteClipboardAction();
})); }));


menu->addChild(createMenuItem("Open", "", [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.load"), "", [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->loadDialog(); weakThis->loadDialog();
})); }));


menu->addChild(createMenuItem("Save as", "", [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.saveAs"), "", [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->saveDialog(); weakThis->saveDialog();
})); }));


menu->addChild(createMenuItem("Save default", "", [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.saveTemplate"), "", [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->saveTemplateDialog(); weakThis->saveTemplateDialog();
})); }));


menu->addChild(createMenuItem("Clear default", "", [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.clearTemplate"), "", [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->clearTemplateDialog(); weakThis->clearTemplateDialog();
@@ -1053,31 +1053,31 @@ void ModuleWidget::createContextMenu() {


// Scan `<user dir>/presets/<plugin slug>/<module slug>` for presets. // Scan `<user dir>/presets/<plugin slug>/<module slug>` for presets.
menu->addChild(new ui::MenuSeparator); menu->addChild(new ui::MenuSeparator);
menu->addChild(createMenuLabel("User presets"));
menu->addChild(createMenuLabel(string::translate("ModuleWidget.userPresets")));
appendPresetItems(menu, weakThis, weakThis->model->getUserPresetDirectory()); appendPresetItems(menu, weakThis, weakThis->model->getUserPresetDirectory());


// Scan `<plugin dir>/presets/<module slug>` for presets. // Scan `<plugin dir>/presets/<module slug>` for presets.
menu->addChild(new ui::MenuSeparator); menu->addChild(new ui::MenuSeparator);
menu->addChild(createMenuLabel("Factory presets"));
menu->addChild(createMenuLabel(string::translate("ModuleWidget.factoryPresets")));
appendPresetItems(menu, weakThis, weakThis->model->getFactoryPresetDirectory()); appendPresetItems(menu, weakThis, weakThis->model->getFactoryPresetDirectory());
})); }));


// Initialize // Initialize
menu->addChild(createMenuItem("Initialize", widget::getKeyCommandName(GLFW_KEY_I, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.initialize"), widget::getKeyCommandName(GLFW_KEY_I, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->resetAction(); weakThis->resetAction();
})); }));


// Randomize // Randomize
menu->addChild(createMenuItem("Randomize", widget::getKeyCommandName(GLFW_KEY_R, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.randomize"), widget::getKeyCommandName(GLFW_KEY_R, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->randomizeAction(); weakThis->randomizeAction();
})); }));


// Disconnect cables // Disconnect cables
menu->addChild(createMenuItem("Disconnect cables", widget::getKeyCommandName(GLFW_KEY_U, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.disconnectCables"), widget::getKeyCommandName(GLFW_KEY_U, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->disconnectAction(); weakThis->disconnectAction();
@@ -1088,35 +1088,35 @@ void ModuleWidget::createContextMenu() {
bool bypassed = module && module->isBypassed(); bool bypassed = module && module->isBypassed();
if (bypassed) if (bypassed)
bypassText += " " CHECKMARK_STRING; bypassText += " " CHECKMARK_STRING;
menu->addChild(createMenuItem("Bypass", bypassText, [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.bypass"), bypassText, [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->bypassAction(!bypassed); weakThis->bypassAction(!bypassed);
})); }));


// Duplicate // Duplicate
menu->addChild(createMenuItem("Duplicate", widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.duplicate"), widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->cloneAction(false); weakThis->cloneAction(false);
})); }));


// Duplicate with cables // Duplicate with cables
menu->addChild(createMenuItem("â”” with cables", widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL | GLFW_MOD_SHIFT), [=]() {
menu->addChild(createMenuItem("â”” " + string::translate("ModuleWidget.duplicateWithCables"), widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL | GLFW_MOD_SHIFT), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->cloneAction(true); weakThis->cloneAction(true);
})); }));


// Delete // Delete
menu->addChild(createMenuItem("Delete", widget::getKeyCommandName(GLFW_KEY_BACKSPACE, 0) + "/" + widget::getKeyCommandName(GLFW_KEY_DELETE, 0), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.delete"), widget::getKeyCommandName(GLFW_KEY_BACKSPACE, 0) + "/" + widget::getKeyCommandName(GLFW_KEY_DELETE, 0), [=]() {
if (!weakThis) if (!weakThis)
return; return;
weakThis->removeAction(); weakThis->removeAction();
}, false, true)); }, false, true));


// Zoom to fit // Zoom to fit
menu->addChild(createMenuItem("Zoom to fit", widget::getKeyCommandName(GLFW_KEY_F4, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("ModuleWidget.zoomFit"), widget::getKeyCommandName(GLFW_KEY_F4, RACK_MOD_CTRL), [=]() {
if (!weakThis) if (!weakThis)
return; return;
APP->scene->rackScroll->zoomToBound(weakThis->getBox()); APP->scene->rackScroll->zoomToBound(weakThis->getBox());


+ 24
- 24
src/app/RackWidget.cpp View File

@@ -585,7 +585,7 @@ static PasteJsonResult RackWidget_pasteJson(RackWidget* that, json_t* rootJ, his


void RackWidget::pasteJsonAction(json_t* rootJ) { void RackWidget::pasteJsonAction(json_t* rootJ) {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "paste modules";
complexAction->name = string::translate("RackWidget.history.pasteModules");
DEFER({ DEFER({
if (!complexAction->isEmpty()) if (!complexAction->isEmpty())
APP->history->push(complexAction); APP->history->push(complexAction);
@@ -611,7 +611,7 @@ void RackWidget::pasteModuleJsonAction(json_t* moduleJ) {
assert(mw->module); assert(mw->module);


history::ComplexAction* h = new history::ComplexAction; history::ComplexAction* h = new history::ComplexAction;
h->name = "paste module";
h->name = string::translate("RackWidget.history.pasteModule");


APP->engine->addModule(mw->module); APP->engine->addModule(mw->module);


@@ -957,7 +957,7 @@ void RackWidget::updateModuleOldPositions() {


history::ComplexAction* RackWidget::getModuleDragAction() { history::ComplexAction* RackWidget::getModuleDragAction() {
history::ComplexAction* h = new history::ComplexAction; history::ComplexAction* h = new history::ComplexAction;
h->name = "move modules";
h->name = string::translate("RackWidget.history.moveModules");


for (ModuleWidget* mw : getModules()) { for (ModuleWidget* mw : getModules()) {
// Create ModuleMove action if the module was moved. // Create ModuleMove action if the module was moved.
@@ -1126,7 +1126,7 @@ void RackWidget::saveSelection(std::string path) {


FILE* file = std::fopen(path.c_str(), "w"); FILE* file = std::fopen(path.c_str(), "w");
if (!file) { if (!file) {
std::string message = string::f("Could not save selection to file %s", path);
std::string message = string::f(string::translate("RackWidget.saveSelectionFailed"), path);
osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str()); osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str());
return; return;
} }
@@ -1167,7 +1167,7 @@ void RackWidget::copyClipboardSelection() {


void RackWidget::resetSelectionAction() { void RackWidget::resetSelectionAction() {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "reset modules";
complexAction->name = string::translate("RackWidget.history.resetModules");


for (ModuleWidget* mw : getSelected()) { for (ModuleWidget* mw : getSelected()) {
assert(mw->module); assert(mw->module);
@@ -1188,7 +1188,7 @@ void RackWidget::resetSelectionAction() {


void RackWidget::randomizeSelectionAction() { void RackWidget::randomizeSelectionAction() {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "randomize modules";
complexAction->name = string::translate("RackWidget.history.randomizeModules");


for (ModuleWidget* mw : getSelected()) { for (ModuleWidget* mw : getSelected()) {
assert(mw->module); assert(mw->module);
@@ -1209,7 +1209,7 @@ void RackWidget::randomizeSelectionAction() {


void RackWidget::disconnectSelectionAction() { void RackWidget::disconnectSelectionAction() {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "disconnect cables";
complexAction->name = string::translate("RackWidget.history.disconnectCables");


for (ModuleWidget* mw : getSelected()) { for (ModuleWidget* mw : getSelected()) {
mw->appendDisconnectActions(complexAction); mw->appendDisconnectActions(complexAction);
@@ -1226,7 +1226,7 @@ void RackWidget::cloneSelectionAction(bool cloneCables) {
DEFER({json_decref(rootJ);}); DEFER({json_decref(rootJ);});


history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "duplicate modules";
complexAction->name = string::translate("RackWidget.history.duplicateModules");
DEFER({ DEFER({
if (!complexAction->isEmpty()) if (!complexAction->isEmpty())
APP->history->push(complexAction); APP->history->push(complexAction);
@@ -1272,7 +1272,7 @@ void RackWidget::cloneSelectionAction(bool cloneCables) {


void RackWidget::bypassSelectionAction(bool bypassed) { void RackWidget::bypassSelectionAction(bool bypassed) {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = bypassed ? "bypass modules" : "un-bypass modules";
complexAction->name = bypassed ? string::translate("RackWidget.history.bypassModules") : string::translate("RackWidget.history.unbypassModules");


for (ModuleWidget* mw : getSelected()) { for (ModuleWidget* mw : getSelected()) {
assert(mw->module); assert(mw->module);
@@ -1304,7 +1304,7 @@ bool RackWidget::isSelectionBypassed() {


void RackWidget::deleteSelectionAction() { void RackWidget::deleteSelectionAction() {
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "delete modules";
complexAction->name = string::translate("RackWidget.history.deleteModules");


// Copy selected set since removing ModuleWidgets modifies it. // Copy selected set since removing ModuleWidgets modifies it.
std::set<ModuleWidget*> selectedModules = getSelected(); std::set<ModuleWidget*> selectedModules = getSelected();
@@ -1362,47 +1362,47 @@ void RackWidget::setSelectionPosNearest(math::Vec delta) {


void RackWidget::appendSelectionContextMenu(ui::Menu* menu) { void RackWidget::appendSelectionContextMenu(ui::Menu* menu) {
int n = getSelected().size(); int n = getSelected().size();
menu->addChild(createMenuLabel(string::f("%d selected %s", n, n == 1 ? "module" : "modules")));
menu->addChild(createMenuLabel(n == 1 ? string::translate("RackWidget.selectedOne") : string::f(string::translate("RackWidget.selectedMany"), n)));


// Enable alwaysConsume of menu items if the number of selected modules changes // Enable alwaysConsume of menu items if the number of selected modules changes


// Select all // Select all
menu->addChild(createMenuItem("Select all", widget::getKeyCommandName(GLFW_KEY_A, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.selectAll"), widget::getKeyCommandName(GLFW_KEY_A, RACK_MOD_CTRL), [=]() {
selectAll(); selectAll();
}, false, true)); }, false, true));


// Deselect // Deselect
menu->addChild(createMenuItem("Deselect", widget::getKeyCommandName(GLFW_KEY_A, RACK_MOD_CTRL | GLFW_MOD_SHIFT), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.deselect"), widget::getKeyCommandName(GLFW_KEY_A, RACK_MOD_CTRL | GLFW_MOD_SHIFT), [=]() {
deselectAll(); deselectAll();
}, n == 0, true)); }, n == 0, true));


// Copy // Copy
menu->addChild(createMenuItem("Copy", widget::getKeyCommandName(GLFW_KEY_C, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.copy"), widget::getKeyCommandName(GLFW_KEY_C, RACK_MOD_CTRL), [=]() {
copyClipboardSelection(); copyClipboardSelection();
}, n == 0)); }, n == 0));


// Paste // Paste
menu->addChild(createMenuItem("Paste", widget::getKeyCommandName(GLFW_KEY_V, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.paste"), widget::getKeyCommandName(GLFW_KEY_V, RACK_MOD_CTRL), [=]() {
pasteClipboardAction(); pasteClipboardAction();
}, false, true)); }, false, true));


// Save // Save
menu->addChild(createMenuItem("Save selection as", "", [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.saveAs"), "", [=]() {
saveSelectionDialog(); saveSelectionDialog();
}, n == 0)); }, n == 0));


// Initialize // Initialize
menu->addChild(createMenuItem("Initialize", widget::getKeyCommandName(GLFW_KEY_I, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.initialize"), widget::getKeyCommandName(GLFW_KEY_I, RACK_MOD_CTRL), [=]() {
resetSelectionAction(); resetSelectionAction();
}, n == 0)); }, n == 0));


// Randomize // Randomize
menu->addChild(createMenuItem("Randomize", widget::getKeyCommandName(GLFW_KEY_R, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.randomize"), widget::getKeyCommandName(GLFW_KEY_R, RACK_MOD_CTRL), [=]() {
randomizeSelectionAction(); randomizeSelectionAction();
}, n == 0)); }, n == 0));


// Disconnect cables // Disconnect cables
menu->addChild(createMenuItem("Disconnect cables", widget::getKeyCommandName(GLFW_KEY_U, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.disconnectCables"), widget::getKeyCommandName(GLFW_KEY_U, RACK_MOD_CTRL), [=]() {
disconnectSelectionAction(); disconnectSelectionAction();
}, n == 0)); }, n == 0));


@@ -1411,22 +1411,22 @@ void RackWidget::appendSelectionContextMenu(ui::Menu* menu) {
bool bypassed = (n > 0) && isSelectionBypassed(); bool bypassed = (n > 0) && isSelectionBypassed();
if (bypassed) if (bypassed)
bypassText += " " CHECKMARK_STRING; bypassText += " " CHECKMARK_STRING;
menu->addChild(createMenuItem("Bypass", bypassText, [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.bypass"), bypassText, [=]() {
bypassSelectionAction(!bypassed); bypassSelectionAction(!bypassed);
}, n == 0, true)); }, n == 0, true));


// Duplicate // Duplicate
menu->addChild(createMenuItem("Duplicate", widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.duplicate"), widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL), [=]() {
cloneSelectionAction(false); cloneSelectionAction(false);
}, n == 0)); }, n == 0));


// Duplicate with cables // Duplicate with cables
menu->addChild(createMenuItem("â”” with cables", widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL | GLFW_MOD_SHIFT), [=]() {
menu->addChild(createMenuItem("â”” " + string::translate("RackWidget.duplicateWithCables"), widget::getKeyCommandName(GLFW_KEY_D, RACK_MOD_CTRL | GLFW_MOD_SHIFT), [=]() {
cloneSelectionAction(true); cloneSelectionAction(true);
}, n == 0)); }, n == 0));


// Delete // Delete
menu->addChild(createMenuItem("Delete", widget::getKeyCommandName(GLFW_KEY_BACKSPACE, 0) + "/" + widget::getKeyCommandName(GLFW_KEY_DELETE, 0), [=]() {
menu->addChild(createMenuItem(string::translate("RackWidget.delete"), widget::getKeyCommandName(GLFW_KEY_BACKSPACE, 0) + "/" + widget::getKeyCommandName(GLFW_KEY_DELETE, 0), [=]() {
deleteSelectionAction(); deleteSelectionAction();
}, n == 0, true)); }, n == 0, true));
} }
@@ -1439,7 +1439,7 @@ void RackWidget::clearCables() {
void RackWidget::clearCablesAction() { void RackWidget::clearCablesAction() {
// Add CableRemove for every cable to a ComplexAction // Add CableRemove for every cable to a ComplexAction
history::ComplexAction* complexAction = new history::ComplexAction; history::ComplexAction* complexAction = new history::ComplexAction;
complexAction->name = "clear cables";
complexAction->name = string::translate("RackWidget.history.clearCables");


for (CableWidget* cw : getCompleteCables()) { for (CableWidget* cw : getCompleteCables()) {
// history::CableRemove // history::CableRemove


+ 57
- 1
translations/en.json View File

@@ -90,5 +90,61 @@
"MenuBar.help.userFolder": "Open user folder", "MenuBar.help.userFolder": "Open user folder",
"MenuBar.help.changelog": "Changelog", "MenuBar.help.changelog": "Changelog",
"MenuBar.help.update": "Update %s", "MenuBar.help.update": "Update %s",
"MenuBar.help.checkUpdate": "Check for %s update"
"MenuBar.help.checkUpdate": "Check for %s update",
"ModuleWidget.history.pastePreset": "paste module preset",
"ModuleWidget.history.loadPreset": "load module preset",
"ModuleWidget.savePresetFailed": "Could not save preset to file %s",
"ModuleWidget.overwriteTemplate": "Overwrite default preset for %s?",
"ModuleWidget.clearTemplate": "Clear default",
"ModuleWidget.history.resetModule": "reset module",
"ModuleWidget.history.randomizeModule": "randomize module",
"ModuleWidget.history.disconnectCables": "Disconnect cables",
"ModuleWidget.history.duplicateModule": "duplicate module",
"ModuleWidget.history.unbypassModule": "un-bypass module",
"ModuleWidget.history.deleteModule": "delete module",
"ModuleWidget.nonePresets": "(None)",
"ModuleWidget.info": "Info",
"ModuleWidget.moduleId": "Module instance ID:",
"ModuleWidget.preset": "Preset",
"ModuleWidget.copy": "Copy",
"ModuleWidget.paste": "Paste",
"ModuleWidget.load": "Open",
"ModuleWidget.saveAs": "Save as",
"ModuleWidget.saveTemplate": "Save default",
"ModuleWidget.userPresets": "User presets",
"ModuleWidget.factoryPresets": "Factory presets",
"ModuleWidget.initialize": "Initialize",
"ModuleWidget.randomize": "Randomize",
"ModuleWidget.disconnectCables": "Disconnect cables",
"ModuleWidget.bypass": "Bypass",
"ModuleWidget.duplicate": "Duplicate",
"ModuleWidget.duplicateWithCables": "with cables",
"ModuleWidget.delete": "Delete",
"ModuleWidget.zoomFit": "Zoom to fit",
"RackWidget.history.pasteModules": "paste modules",
"RackWidget.history.pasteModule": "paste module",
"RackWidget.history.moveModules": "move modules",
"RackWidget.saveSelectionFailed": "Could not save selection to file %s",
"RackWidget.history.resetModules": "reset modules",
"RackWidget.history.randomizeModules": "randomize modules",
"RackWidget.history.disconnectCables": "disconnect cables",
"RackWidget.history.duplicateModules": "duplicate modules",
"RackWidget.history.bypassModules": "bypass modules",
"RackWidget.history.unbypassModules": "un-bypass modules",
"RackWidget.history.deleteModules": "delete modules",
"RackWidget.selectedOne": "1 selected module",
"RackWidget.selectedMany": "%d selected modules",
"RackWidget.selectAll": "Select all",
"RackWidget.deselect": "Deselect",
"RackWidget.copy": "Copy",
"RackWidget.paste": "Paste",
"RackWidget.saveAs": "Save selection as",
"RackWidget.initialize": "Initialize",
"RackWidget.randomize": "Randomize",
"RackWidget.disconnectCables": "Disconnect cables",
"RackWidget.bypass": "Bypass",
"RackWidget.duplicate": "Duplicate",
"RackWidget.duplicateWithCables": "with cables",
"RackWidget.delete": "Delete",
"RackWidget.history.clearCables": "clear cables"
} }

Loading…
Cancel
Save