1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop: Fixes #5927: Update menu item labels when the language changes

This commit is contained in:
Laurent Cozic
2021-12-31 07:50:32 +01:00
parent e813d15ef2
commit f451633a51
3 changed files with 19 additions and 7 deletions

View File

@ -97,8 +97,8 @@ export default class MenuUtils {
});
}
public commandsToMenuItems(commandNames: string[], onClick: Function): MenuItems {
const key: string = `${this.keymapService.lastSaveTime}_${commandNames.join('_')}`;
public commandsToMenuItems(commandNames: string[], onClick: Function, locale: string): MenuItems {
const key: string = `${this.keymapService.lastSaveTime}_${commandNames.join('_')}_${locale}`;
if (this.menuItemCache_[key]) return this.menuItemCache_[key];
const output: MenuItems = {};
@ -107,7 +107,9 @@ export default class MenuUtils {
output[commandName] = this.commandToMenuItem(commandName, onClick);
}
this.menuItemCache_[key] = output;
this.menuItemCache_ = {
[key]: output,
};
return output;
}