diff --git a/README.md b/README.md index b77eed92..231d82ed 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,7 @@ Check "Tool > Experimental > Reuse analysis" in the menu. This is expected to be * Read variations in SGF. * Show start-up log when engine is down. * Improve thumbnails (delay, color, etc.). +* Add Japanese help. * Fix blur in HiDPI display. * Experimentally support saving/loading analyses in SGF. (See the above section.) diff --git a/src/main.js b/src/main.js index 8c6c0560..3d8983b9 100644 --- a/src/main.js +++ b/src/main.js @@ -1,3 +1,5 @@ +// -*- coding: utf-8 -*- + ///////////////////////////////////////////////// // electron const electron = require('electron') @@ -610,7 +612,8 @@ function menu_template(win) { {role: 'toggleDevTools'}, ]) const help_menu = menu('Help', [ - item('Help', undefined, help), + item('en (English)', undefined, help), + item('ja (日本語)', undefined, () => open_help('help_ja.html')), ]) return [file_menu, edit_menu, view_menu, tool_menu, engine_menu, ...preset_menu_maybe({menu, item, sep, white_unloader_item, win}), @@ -1049,14 +1052,15 @@ function close_window_or_cut_sequence(win) { attached ? null : (sequence.length <= 1 && game.is_empty()) ? win.close() : cut_sequence() } -function help() { +function help() {open_help('help.html')} +function open_help(file_name) { const menu = [ {label: 'File', submenu: [{role: 'close'}]}, {label: 'View', submenu: [{role: 'zoomIn'}, {role: 'zoomOut'}, {role: 'resetZoom'}]} ] const opt = {webPreferences: {nodeIntegration: true}} - get_new_window('help.html', opt).setMenu(Menu.buildFromTemplate(menu)) + get_new_window(file_name, opt).setMenu(Menu.buildFromTemplate(menu)) } function info_text() { const f = (label, s) => s ?