1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Fixed and simplified translations

This commit is contained in:
Laurent Cozic 2020-09-15 12:08:25 +01:00
parent 40e24102ce
commit 851eee1500
3 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => {
const keymapFile = await shim.fsDriver().readFile(actualFilePath, 'utf-8');
overrideKeymapItems(JSON.parse(keymapFile));
} catch (err) {
bridge().showErrorMessageBox(`${_('An unexpected error occured while importing the keymap!')}\n${err.message}`);
bridge().showErrorMessageBox(_('Error: %s', err.message));
}
}
};

View File

@ -4,7 +4,7 @@ const { reg } = require('lib/registry.js');
export const declaration:CommandDeclaration = {
name: 'synchronize',
label: () => _('Synchronize'),
label: () => _('Synchronise'),
iconName: 'fa-sync-alt',
};

View File

@ -136,7 +136,7 @@ export default class KeymapService extends BaseService {
this.overrideKeymap(JSON.parse(customKeymapFile));
} catch (err) {
const message = err.message || '';
throw new Error(`${_('Error loading the keymap from file: %s', customKeymapPath)}\n${message}`);
throw new Error(_('Error: %s', message));
}
}
}
@ -153,7 +153,7 @@ export default class KeymapService extends BaseService {
eventManager.emit('keymapChange');
} catch (err) {
const message = err.message || '';
throw new Error(`${_('Error saving the keymap to file: %s', customKeymapPath)}\n${message}`);
throw new Error(_('Error: %s', message));
}
}
@ -227,18 +227,18 @@ export default class KeymapService extends BaseService {
private validateKeymapItem(item: KeymapItem) {
if (!item.hasOwnProperty('command')) {
throw new Error(_('Keymap item %s is missing the required "command" property.', JSON.stringify(item)));
throw new Error(_('"%s" is missing the required "%s" property.', JSON.stringify(item), 'command'));
} else if (!this.keymap.hasOwnProperty(item.command)) {
throw new Error(_('Keymap item %s is invalid because %s is not a valid command.', JSON.stringify(item), item.command));
throw new Error(_('Invalid %s: %s.', 'command', item.command));
}
if (!item.hasOwnProperty('accelerator')) {
throw new Error(_('Keymap item %s is missing the required "accelerator" property.', JSON.stringify(item)));
throw new Error(_('"%s" is missing the required "%s" property.', JSON.stringify(item), 'accelerator'));
} else if (item.accelerator !== null) {
try {
this.validateAccelerator(item.accelerator);
} catch {
throw new Error(_('Keymap item %s is invalid because %s is not a valid accelerator.', JSON.stringify(item), item.accelerator));
throw new Error(_('Invalid %s: %s.', 'accelerator', item.command));
}
}
}