mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
ELECTRON-669: add japanese localisation for download manager actions (#477)
Currently, the actions "Open" & "Show in Folder" are not localised as part of the download manager. This commit adds japanese localisation for the above two actions. Along with the above, we also add a better UX by using the string "Reveal in Finder" for macOS users.
This commit is contained in:
parent
418de90fb3
commit
74e5123e48
@ -7,6 +7,9 @@ const local = {
|
||||
downloadItems: []
|
||||
};
|
||||
|
||||
let showInFolderText = "Show in Folder";
|
||||
let openText = "Open";
|
||||
|
||||
// listen for file download complete event
|
||||
local.ipcRenderer.on('downloadCompleted', (event, arg) => {
|
||||
createDOM(arg);
|
||||
@ -17,6 +20,20 @@ local.ipcRenderer.on('downloadProgress', () => {
|
||||
initiate();
|
||||
});
|
||||
|
||||
// listen for locale change and update
|
||||
local.ipcRenderer.on('locale-changed', (event, data) => {
|
||||
|
||||
if (data && typeof data === 'object') {
|
||||
|
||||
if (data.downloadManager) {
|
||||
showInFolderText = data.downloadManager['Show in Folder'];
|
||||
openText = data.downloadManager.Open;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Open file in default app.
|
||||
* @param id
|
||||
@ -137,7 +154,7 @@ function createDOM(arg) {
|
||||
|
||||
let caretLiOpen = document.createElement('li');
|
||||
caretLiOpen.id = 'download-open';
|
||||
caretLiOpen.innerHTML = 'Open';
|
||||
caretLiOpen.innerHTML = openText;
|
||||
caretUL.appendChild(caretLiOpen);
|
||||
let openFileDocument = document.getElementById('download-open');
|
||||
openFileDocument.addEventListener('click', () => {
|
||||
@ -147,7 +164,7 @@ function createDOM(arg) {
|
||||
|
||||
let caretLiShow = document.createElement('li');
|
||||
caretLiShow.id = 'download-show-in-folder';
|
||||
caretLiShow.innerHTML = 'Show in Folder';
|
||||
caretLiShow.innerHTML = showInFolderText;
|
||||
caretUL.appendChild(caretLiShow);
|
||||
let showInFinderDocument = document.getElementById('download-show-in-folder');
|
||||
showInFinderDocument.addEventListener('click', () => {
|
||||
|
@ -1008,6 +1008,12 @@ function setLocale(browserWindow, opts) {
|
||||
}
|
||||
|
||||
localeContent.contextMenu = i18n.getMessageFor('ContextMenu');
|
||||
|
||||
localeContent.downloadManager = i18n.getMessageFor('DownloadManager');
|
||||
if (isMac) {
|
||||
localeContent.downloadManager['Show in Folder'] = localeContent.downloadManager['Reveal in Finder'];
|
||||
}
|
||||
|
||||
browserWindow.webContents.send('locale-changed', localeContent);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,11 @@
|
||||
"Reload": "Reload",
|
||||
"Search with Google": "Search with Google"
|
||||
},
|
||||
"DownloadManager": {
|
||||
"Show in Folder": "Show in Folder",
|
||||
"Reveal in Finder": "Reveal in Finder",
|
||||
"Open": "Open"
|
||||
},
|
||||
"Copy": "Copy",
|
||||
"Custom": "Custom",
|
||||
"Cut": "Cut",
|
||||
|
@ -32,6 +32,11 @@
|
||||
"Reload": "Reload",
|
||||
"Search with Google": "Search with Google"
|
||||
},
|
||||
"DownloadManager": {
|
||||
"Show in Folder": "Show in Folder",
|
||||
"Reveal in Finder": "Reveal in Finder",
|
||||
"Open": "Open"
|
||||
},
|
||||
"Copy": "Copy",
|
||||
"Custom": "Custom",
|
||||
"Cut": "Cut",
|
||||
|
@ -32,6 +32,11 @@
|
||||
"Reload": "リロード",
|
||||
"Search with Google": "Googleで検索"
|
||||
},
|
||||
"DownloadManager": {
|
||||
"Show in Folder": "フォルダで見て",
|
||||
"Reveal in Finder": "Finderで明らかにする",
|
||||
"Open": "開いた"
|
||||
},
|
||||
"Copy": "コピー",
|
||||
"Custom": "カスタム",
|
||||
"Cut": "切り取り",
|
||||
|
@ -32,6 +32,11 @@
|
||||
"Reload": "リロード",
|
||||
"Search with Google": "Googleで検索"
|
||||
},
|
||||
"DownloadManager": {
|
||||
"Show in Folder": "フォルダで見て",
|
||||
"Reveal in Finder": "Finderで明らかにする",
|
||||
"Open": "開いた"
|
||||
},
|
||||
"Copy": "コピー",
|
||||
"Custom": "カスタム",
|
||||
"Cut": "切り取り",
|
||||
|
Loading…
Reference in New Issue
Block a user