feat(translations): menu translations
This commit is contained in:
parent
0d39bbd9c3
commit
3056779895
@ -160,7 +160,6 @@ class App extends Component {
|
||||
return (
|
||||
<MuiThemeProvider>
|
||||
<div>
|
||||
{ __('welcome') }
|
||||
{
|
||||
((window.currentWindow && !window.currentWindow.isModal()) || typeof WEB !== 'undefined')
|
||||
&&
|
||||
|
@ -11,10 +11,10 @@ import createWindow from "./helpers/window";
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
|
||||
import { devMenuTemplate } from "./menu/dev_menu_template";
|
||||
import { editMenuTemplate } from "./menu/edit_menu_template";
|
||||
import { editMenuTemplateFunc } from "./menu/edit_menu_template";
|
||||
import { settingsMenuTemplateFunc } from "./menu/config_menu_template";
|
||||
import { aboutMenuTemplate } from "./menu/about_menu_template";
|
||||
import { manageMenuTemplate } from "./menu/manage_menu_template";
|
||||
import { aboutMenuTemplateFunc } from "./menu/about_menu_template";
|
||||
import { manageMenuTemplateFunc } from "./menu/manage_menu_template";
|
||||
|
||||
// Special module holding environment variables which you declared
|
||||
// in config/env_xxx.json file.
|
||||
@ -58,7 +58,7 @@ const setApplicationMenu = () => {
|
||||
// update menu translation
|
||||
changeLanguage(lang, () => setApplicationMenu())
|
||||
})
|
||||
const menus = [editMenuTemplate, manageMenuTemplate, settingsMenuTemplate, aboutMenuTemplate];
|
||||
const menus = [editMenuTemplateFunc(), manageMenuTemplateFunc(), settingsMenuTemplate, aboutMenuTemplateFunc()];
|
||||
|
||||
if (env.name !== "production") {
|
||||
menus.push(devMenuTemplate);
|
||||
|
@ -1,12 +1,13 @@
|
||||
import { app, BrowserWindow, shell } from "electron";
|
||||
import path from "path";
|
||||
import url from "url";
|
||||
import __ from '../../app/translation'
|
||||
|
||||
export const aboutMenuTemplate = {
|
||||
label: "About",
|
||||
export const aboutMenuTemplateFunc = () => ({
|
||||
label: __("About"),
|
||||
submenu: [
|
||||
{
|
||||
label: "Changelog",
|
||||
label: __("Changelog"),
|
||||
accelerator: "CmdOrCtrl+]",
|
||||
click: () => {
|
||||
const win = new BrowserWindow({
|
||||
@ -35,14 +36,14 @@ export const aboutMenuTemplate = {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Bug Report",
|
||||
label: __("Bug Report"),
|
||||
accelerator: "CmdOrCtrl+[",
|
||||
click: () => {
|
||||
shell.openExternal('https://github.com/DEgITx/rats-search/issues')
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Donate",
|
||||
label: __("Donate"),
|
||||
accelerator: "CmdOrCtrl+*",
|
||||
click: () => {
|
||||
const win = new BrowserWindow({
|
||||
@ -72,25 +73,25 @@ export const aboutMenuTemplate = {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Help (Documentation)",
|
||||
label: __("Help (Documentation)"),
|
||||
accelerator: "CmdOrCtrl+?",
|
||||
click: () => {
|
||||
shell.openExternal('https://github.com/DEgITx/rats-search/blob/master/docs/MANUAL.md')
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Support (Discussion)",
|
||||
label: __("Support (Discussion)"),
|
||||
accelerator: "CmdOrCtrl+>",
|
||||
click: () => {
|
||||
shell.openExternal('https://discord.gg/t9GQtxA')
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "About (GitHub)",
|
||||
label: __("About (GitHub)"),
|
||||
accelerator: "CmdOrCtrl+<",
|
||||
click: () => {
|
||||
shell.openExternal('https://github.com/DEgITx/rats-search')
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
});
|
||||
|
@ -4,17 +4,17 @@ import path from 'path'
|
||||
import __, { translationsDir } from '../../app/translation'
|
||||
|
||||
export const settingsMenuTemplateFunc = (config, onLanguageChange) => ({
|
||||
label: "Settings",
|
||||
label: __("Settings"),
|
||||
submenu: [
|
||||
{
|
||||
label: "Main settings",
|
||||
label: __("Main Settings"),
|
||||
accelerator: "CmdOrCtrl+O",
|
||||
click: () => {
|
||||
BrowserWindow.getFocusedWindow().webContents.send('url', '/config')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Torrents filters",
|
||||
label: __("Torrents Filters"),
|
||||
accelerator: "CmdOrCtrl+\\",
|
||||
click: () => {
|
||||
BrowserWindow.getFocusedWindow().webContents.send('url', '/filters')
|
||||
|
@ -1,12 +1,14 @@
|
||||
export const editMenuTemplate = {
|
||||
label: "Edit",
|
||||
import __ from '../../app/translation'
|
||||
|
||||
export const editMenuTemplateFunc = () => ({
|
||||
label: __("Edit"),
|
||||
submenu: [
|
||||
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
|
||||
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
|
||||
{ label: __("Undo"), accelerator: "CmdOrCtrl+Z", selector: "undo:" },
|
||||
{ label: __("Redo"), accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
|
||||
{ type: "separator" },
|
||||
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
|
||||
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
|
||||
{ label: __("Cut"), accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: __("Copy"), accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
{ label: __("Paste"), accelerator: "CmdOrCtrl+V", selector: "paste:" },
|
||||
{ label: __("Select All"), accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
|
||||
]
|
||||
};
|
||||
});
|
||||
|
@ -1,30 +1,31 @@
|
||||
import { app, BrowserWindow, shell } from "electron";
|
||||
import path from "path";
|
||||
import url from "url";
|
||||
import __ from '../../app/translation'
|
||||
|
||||
export const manageMenuTemplate = {
|
||||
label: "Manage",
|
||||
export const manageMenuTemplateFunc = () => ({
|
||||
label: __("Manage"),
|
||||
submenu: [
|
||||
{
|
||||
label: "Downloads",
|
||||
label: __("Downloads"),
|
||||
accelerator: "CmdOrCtrl+d",
|
||||
click: () => {
|
||||
BrowserWindow.getFocusedWindow().webContents.send('url', '/downloads')
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Search",
|
||||
label: __("Search"),
|
||||
accelerator: "CmdOrCtrl+n",
|
||||
click: () => {
|
||||
BrowserWindow.getFocusedWindow().webContents.send('url', '/')
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Top",
|
||||
label: __("Top"),
|
||||
accelerator: "CmdOrCtrl+t",
|
||||
click: () => {
|
||||
BrowserWindow.getFocusedWindow().webContents.send('url', '/top')
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
});
|
||||
|
@ -3,6 +3,26 @@
|
||||
"nameOriginal": "English",
|
||||
"translations": {
|
||||
"Language": "Language",
|
||||
"welcome": "welcome"
|
||||
"Settings": "Settings",
|
||||
"Main Settings": "Main Settings",
|
||||
"Torrents Filters": "Torrents Filters",
|
||||
"Edit": "Edit",
|
||||
"Undo": "Undo",
|
||||
"Redo": "Redo",
|
||||
"Cut": "Cut",
|
||||
"Copy": "Copy",
|
||||
"Paste": "Paste",
|
||||
"Select All": "Select All",
|
||||
"Manage": "Manage",
|
||||
"Downloads": "Downloads",
|
||||
"Search": "Search",
|
||||
"Top": "Top",
|
||||
"About": "About",
|
||||
"Changelog": "Changelog",
|
||||
"Bug Report": "Bug Report",
|
||||
"Donate": "Donate",
|
||||
"Help (Documentation)": "Help (Documentation)",
|
||||
"Support (Discussion)": "Support (Discussion)",
|
||||
"About (GitHub)": "About (GitHub)"
|
||||
}
|
||||
}
|
@ -3,6 +3,26 @@
|
||||
"nameOriginal": "Русский",
|
||||
"translations": {
|
||||
"Language": "Язык",
|
||||
"welcome": "Добро пожаловать"
|
||||
"Settings": "Настройки",
|
||||
"Main Settings": "Главные настройки",
|
||||
"Torrents Filters": "Фильтры торрентов",
|
||||
"Edit": "Редактировать",
|
||||
"Undo": "Отменить",
|
||||
"Redo": "Повторить",
|
||||
"Cut": "Вырезать",
|
||||
"Copy": "Копировать",
|
||||
"Paste": "Вставить",
|
||||
"Select All": "Выбрать все",
|
||||
"Manage": "Управление",
|
||||
"Downloads": "Закачки",
|
||||
"Search": "Поиск",
|
||||
"Top": "Топ",
|
||||
"About": "О программе",
|
||||
"Changelog": "Список изменений",
|
||||
"Bug Report": "Сообщить об ошибке",
|
||||
"Donate": "Пожертвовать на развитие",
|
||||
"Help (Documentation)": "Помощь (Документация)",
|
||||
"Support (Discussion)": "Помощь (Обсуждение)",
|
||||
"About (GitHub)": "О программе (на GitHub)"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user