1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/ElectronClient/gui/KeymapConfig/utils/getLabel.js

34 lines
2.5 KiB
JavaScript
Raw Normal View History

2020-08-30 21:42:09 +02:00
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const CommandService_1 = require('../../../lib/services/CommandService');
const { _ } = require('lib/locale');
const { shim } = require('lib/shim');
const commandService = CommandService_1.default.instance();
const getLabel = (commandName) => {
if (commandService.exists(commandName)) { return commandService.label(commandName); }
// Some commands are not registered in CommandService at the moment
// Following hard-coded labels are used as a workaround
switch (commandName) {
case 'quit':
return _('Quit');
case 'insertTemplate':
return _('Insert template');
case 'zoomActualSize':
return _('Actual Size');
case 'gotoAnything':
return _('Goto Anything...');
case 'help':
return _('Website and documentation');
case 'hideApp':
return _('Hide Joplin');
case 'closeWindow':
return _('Close Window');
case 'config':
return shim.isMac() ? _('Preferences') : _('Options');
default:
throw new Error(`Command: ${commandName} is unknown`);
}
};
exports.default = getLabel;
// # sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0TGFiZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJnZXRMYWJlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHlFQUFrRTtBQUVsRSxNQUFNLEVBQUUsQ0FBQyxFQUFFLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ3BDLE1BQU0sRUFBRSxJQUFJLEVBQUUsR0FBRyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUM7QUFFckMsTUFBTSxjQUFjLEdBQUcsd0JBQWMsQ0FBQyxRQUFRLEVBQUUsQ0FBQztBQUVqRCxNQUFNLFFBQVEsR0FBRyxDQUFDLFdBQW1CLEVBQUUsRUFBRTtJQUN4QyxJQUFJLGNBQWMsQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDO1FBQUUsT0FBTyxjQ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