Browse Source

Translate module tags.

tags/v2.6.1
Andrew Belt 5 months ago
parent
commit
3316c1efed
3 changed files with 72 additions and 6 deletions
  1. +12
    -4
      src/app/Browser.cpp
  2. +2
    -1
      src/plugin/Model.cpp
  3. +58
    -1
      translations/en.json

+ 12
- 4
src/app/Browser.cpp View File

@@ -55,6 +55,11 @@ static void modelDbInit() {
// Get search fields for model
std::string tagStr;
for (int tagId : model->tagIds) {
// If non-English, add translation of tag before English tags
if (settings::language != "en") {
tagStr += string::translate("tag." + tag::getTag(tagId), settings::language);
tagStr += " ";
}
// Add all aliases of a tag
for (const std::string& tagAlias : tag::tagAliases[tagId]) {
tagStr += tagAlias;
@@ -68,7 +73,7 @@ static void modelDbInit() {
model->description,
tagStr,
};
// DEBUG("%s; %s; %s; %s; %s; %s", fields[0].c_str(), fields[1].c_str(), fields[2].c_str(), fields[3].c_str(), fields[4].c_str());
// DEBUG("%s; %s; %s; %s; %s", fields[0].c_str(), fields[1].c_str(), fields[2].c_str(), fields[3].c_str(), fields[4].c_str());
modelDb.addEntry(model, fields);
}
}
@@ -310,7 +315,8 @@ struct ModelBox : widget::OpaqueWidget {
text += string::translate("Browser.tooltipTags");
std::vector<std::string> tags;
for (int tagId : model->tagIds) {
tags.push_back(tag::getTag(tagId));
std::string tag = string::translate("tag." + tag::getTag(tagId));
tags.push_back(tag);
}
text += string::join(tags, ", ");
ui::Tooltip* tooltip = new ui::Tooltip;
@@ -988,7 +994,8 @@ inline void TagButton::onAction(const ActionEvent& e) {

for (int tagId = 0; tagId < (int) tag::tagAliases.size(); tagId++) {
TagItem* tagItem = new TagItem;
tagItem->text = tag::getTag(tagId);
std::string tag = string::translate("tag." + tag::getTag(tagId));
tagItem->text = tag;
tagItem->tagId = tagId;
tagItem->browser = browser;
tagItem->disabled = !browser->hasVisibleModel(browser->brand, {tagId}, browser->favorite);
@@ -1004,7 +1011,8 @@ inline void TagButton::step() {
for (int tagId : browser->tagIds) {
if (!firstTag)
text += ", ";
text += tag::getTag(tagId);
std::string tag = string::translate("tag." + tag::getTag(tagId));
text += tag;
firstTag = false;
}
}


+ 2
- 1
src/plugin/Model.cpp View File

@@ -135,7 +135,8 @@ void Model::appendContextMenu(ui::Menu* menu, bool inBrowser) {
if (!tagIds.empty()) {
menu->addChild(createMenuLabel(string::translate("Model.tags")));
for (int tagId : tagIds) {
menu->addChild(createMenuLabel("• " + tag::getTag(tagId)));
std::string tag = string::translate("tag." + tag::getTag(tagId));
menu->addChild(createMenuLabel("• " + tag));
}
}



+ 58
- 1
translations/en.json View File

@@ -19,7 +19,63 @@
"key.ctrl": "Ctrl",
"key.shift": "Shift",
"key.alt": "Alt",
"MenuBar.infoLabel": "%.1f fps %.1f%% avg %.1f%% max",
"tag.Arpeggiator": "Arpeggiator",
"tag.Attenuator": "Attenuator",
"tag.Blank": "Blank",
"tag.Chorus": "Chorus",
"tag.Clock generator": "Clock generator",
"tag.Clock modulator": "Clock modulator",
"tag.Compressor": "Compressor",
"tag.Controller": "Controller",
"tag.Delay": "Delay",
"tag.Digital": "Digital",
"tag.Distortion": "Distortion",
"tag.Drum": "Drum",
"tag.Dual": "Dual",
"tag.Dynamics": "Dynamics",
"tag.Effect": "Effect",
"tag.Envelope follower": "Envelope follower",
"tag.Envelope generator": "Envelope generator",
"tag.Equalizer": "Equalizer",
"tag.Expander": "Expander",
"tag.External": "External",
"tag.Filter": "Filter",
"tag.Flanger": "Flanger",
"tag.Function generator": "Function generator",
"tag.Granular": "Granular",
"tag.Hardware clone": "Hardware clone",
"tag.Limiter": "Limiter",
"tag.Logic": "Logic",
"tag.Low-frequency oscillator": "Low-frequency oscillator",
"tag.Low-pass gate": "Low-pass gate",
"tag.MIDI": "MIDI",
"tag.Mixer": "Mixer",
"tag.Multiple": "Multiple",
"tag.Noise": "Noise",
"tag.Oscillator": "Oscillator",
"tag.Panning": "Panning",
"tag.Phaser": "Phaser",
"tag.Physical modeling": "Physical modeling",
"tag.Polyphonic": "Polyphonic",
"tag.Quad": "Quad",
"tag.Quantizer": "Quantizer",
"tag.Random": "Random",
"tag.Recording": "Recording",
"tag.Reverb": "Reverb",
"tag.Ring modulator": "Ring modulator",
"tag.Sample and hold": "Sample and hold",
"tag.Sampler": "Sampler",
"tag.Sequencer": "Sequencer",
"tag.Slew limiter": "Slew limiter",
"tag.Speech": "Speech",
"tag.Switch": "Switch",
"tag.Synth voice": "Synth voice",
"tag.Tuner": "Tuner",
"tag.Utility": "Utility",
"tag.Visual": "Visual",
"tag.Vocoder": "Vocoder",
"tag.Voltage-controlled amplifier": "Voltage-controlled amplifier",
"tag.Waveshaper": "Waveshaper",
"MenuBar.file": "File",
"MenuBar.file.new": "New",
"MenuBar.file.open": "Open",
@@ -111,6 +167,7 @@
"MenuBar.help.changelog": "Changelog",
"MenuBar.help.update": "Update %s",
"MenuBar.help.checkUpdate": "Check for %s update",
"MenuBar.infoLabel": "%.1f fps %.1f%% avg %.1f%% max",
"ModuleWidget.history.pastePreset": "paste module preset",
"ModuleWidget.history.loadPreset": "load module preset",
"ModuleWidget.savePresetFailed": "Could not save preset to file %s",


Loading…
Cancel
Save