Migrate translations to keys and switch to Localazy (#1198)
This commit is contained in:
+13
-11
@@ -105,7 +105,7 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
|
||||
if (params.hasImageContents) {
|
||||
popupMenu.append(
|
||||
new MenuItem({
|
||||
label: _t("Copy image"),
|
||||
label: _t("right_click_menu|copy_image"),
|
||||
accelerator: "c",
|
||||
click(): void {
|
||||
webContents.copyImageAt(params.x, params.y);
|
||||
@@ -120,7 +120,7 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
|
||||
if (url.startsWith(MAILTO_PREFIX)) {
|
||||
popupMenu.append(
|
||||
new MenuItem({
|
||||
label: _t("Copy email address"),
|
||||
label: _t("right_click_menu|copy_email"),
|
||||
accelerator: "a",
|
||||
click(): void {
|
||||
clipboard.writeText(url.substr(MAILTO_PREFIX.length));
|
||||
@@ -130,7 +130,9 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
|
||||
} else {
|
||||
popupMenu.append(
|
||||
new MenuItem({
|
||||
label: params.hasImageContents ? _t("Copy image address") : _t("Copy link address"),
|
||||
label: params.hasImageContents
|
||||
? _t("right_click_menu|copy_image_url")
|
||||
: _t("right_click_menu|copy_link_url"),
|
||||
accelerator: "a",
|
||||
click(): void {
|
||||
clipboard.writeText(url);
|
||||
@@ -145,7 +147,7 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
|
||||
if (params.hasImageContents && !url.startsWith("blob:")) {
|
||||
popupMenu.append(
|
||||
new MenuItem({
|
||||
label: _t("Save image as..."),
|
||||
label: _t("right_click_menu|save_image_as"),
|
||||
accelerator: "s",
|
||||
async click(): Promise<void> {
|
||||
const targetFileName = params.suggestedFilename || params.altText || "image.png";
|
||||
@@ -168,8 +170,8 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
|
||||
console.error(err);
|
||||
dialog.showMessageBox({
|
||||
type: "error",
|
||||
title: _t("Failed to save image"),
|
||||
message: _t("The image failed to save"),
|
||||
title: _t("right_click_menu|save_image_as_error_title"),
|
||||
message: _t("right_click_menu|save_image_as_error_description"),
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -199,7 +201,7 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
label: _t("Add to dictionary"),
|
||||
label: _t("right_click_menu|add_to_dictionary"),
|
||||
click: (menuItem, browserWindow) => {
|
||||
browserWindow?.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
|
||||
},
|
||||
@@ -213,19 +215,19 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
|
||||
options.push(
|
||||
{
|
||||
role: "cut",
|
||||
label: _t("Cut"),
|
||||
label: _t("action|cut"),
|
||||
accelerator: "t",
|
||||
enabled: params.editFlags.canCut,
|
||||
},
|
||||
{
|
||||
role: "copy",
|
||||
label: _t("Copy"),
|
||||
label: _t("action|copy"),
|
||||
accelerator: "c",
|
||||
enabled: params.editFlags.canCopy,
|
||||
},
|
||||
{
|
||||
role: "paste",
|
||||
label: _t("Paste"),
|
||||
label: _t("action|paste"),
|
||||
accelerator: "p",
|
||||
enabled: params.editFlags.canPaste,
|
||||
},
|
||||
@@ -235,7 +237,7 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
|
||||
},
|
||||
{
|
||||
role: "selectAll",
|
||||
label: _t("Select All"),
|
||||
label: _t("action|select_all"),
|
||||
accelerator: "a",
|
||||
enabled: params.editFlags.canSelectAll,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user