Skip to content

Commit

Permalink
进一步汉化
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeng-git committed Oct 5, 2024
1 parent 2e89172 commit cb559f5
Show file tree
Hide file tree
Showing 18 changed files with 202 additions and 108 deletions.
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>PiKVM Index</title>
<title>One-KVM Index</title>
<link rel="apple-touch-icon" sizes="180x180" href="/share/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/share/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/share/favicon-16x16.png">
Expand Down
2 changes: 1 addition & 1 deletion web/index.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends start.pug

append vars
- title = "PiKVM Index"
- title = "One-KVM Index"
- main_js = "index/main"
- css_list = css_list.concat(["window", "modal", "index/index"])

Expand Down
90 changes: 45 additions & 45 deletions web/kvm/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/kvm/navbar-atx.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ li(id="atx-dropdown" class="right feature-disabled")
b Control the server's power#[br]
sub Use the short click for ACPI shutdown
hr
+menu_switch("atx-ask-switch", "Ask click confirmation", true, true)
+menu_switch("atx-ask-switch", "Ask click confirmation", true, true,"atx-ask-switch")
hr
div(class="buttons")
button(disabled data-force-hide-menu id="atx-power-button") &bull; Click Power #[sup #[i short]]
Expand Down
2 changes: 1 addition & 1 deletion web/kvm/navbar-macro.pug
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ li(id="macro-dropdown" class="right")
td(id="hid-recorder-events-count" class="value") 0
td #[sup #[i(i18n="kvm_text41") include delays]]
hr
+menu_switch("hid-recorder-loop-switch", "Infinite loop playback", false, false)
+menu_switch("hid-recorder-loop-switch", "Infinite loop playback", false, false, "hid-recorder-loop-switch")
hr
input(type="file" id="hid-recorder-new-script-file")
div(class="buttons buttons-row")
Expand Down
52 changes: 26 additions & 26 deletions web/kvm/navbar-msd.pug
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
li(id="msd-dropdown" class="right feature-disabled")
a(class="menu-button" href="#")
+navbar_led("msd-led", "led-msd")
span Drive
span(i18n="kvm_text60") Drive
div(id="msd-menu" class="menu")
div(class="text")
b Mass Storage Drive:
b(i18n="kvm_text61") Mass Storage Drive:
span(id="msd-status")
br
hr
div(id="msd-message-offline" class="hidden")
+menu_message("warning", "Mass Storage Drive is offline")
+menu_message("warning", "Mass Storage Drive is offline", "msd-message-offline")
hr
div(id="msd-message-image-broken" class="hidden")
+menu_message("warning", "Current image is broken!")
+menu_message("warning", "Current image is broken!", "msd-message-image-broken")
| Perhaps uploading was interrupted#[br]
hr
div(id="msd-message-too-big-for-cdrom" class="hidden")
+menu_message("warning", "Current image is too big for CD-ROM!")
+menu_message("warning", "Current image is too big for CD-ROM!", "msd-message-too-big-for-cdrom")
| The device filesystem will be truncated to 2.2GiB
hr
div(id="msd-message-out-of-storage" class="hidden")
+menu_message("warning", "Current image is out of storage")
+menu_message("warning", "Current image is out of storage", "msd-message-out-of-storage")
| This image was connected manually using #[b kvmd-otgmsd]
hr
div(id="msd-message-rw-enabled" class="hidden")
+menu_message("warning", "Read-write mode is enabled")
+menu_message("warning", "Read-write mode is enabled", "msd-message-rw-enabled")
| Do not turn off PiKVM while this is active to prevent#[br]
| filesystem corruption. Use read-only mode where possible,#[br]
| as writing to SD card often can reduce its lifespan.
hr
div(id="msd-message-downloads" class="hidden")
+menu_message("info", "The image is being downloaded from PiKVM")
+menu_message("info", "The image is being downloaded from PiKVM", "msd-message-downloads")
| Please wait
hr
table(class="kv")
tr
td Image:
td(i18n="kvm_text62") Image:
td(width="100%") #[select(disabled id="msd-image-selector")]
td #[button(disabled id="msd-download-button" title="Download image") #[b &nbsp;&nbsp;&#x21E9;&nbsp;&nbsp;]]
td #[button(disabled id="msd-remove-button" title="Remove image") #[b &nbsp;&nbsp;&times;&nbsp;&nbsp;]]
table(class="kv")
tr
td Drive #[a(target="_blank" href="https://docs.pikvm.org/msd") mode]:
td(i18n="kvm_text63") Drive #[a(target="_blank" href="https://docs.pikvm.org/msd") mode]:
td
div(class="radio-box")
input(checked type="radio" id="msd-mode-radio-cdrom" name="msd-mode-radio" value="1")
label(for="msd-mode-radio-cdrom") CD-ROM
input(type="radio" id="msd-mode-radio-flash" name="msd-mode-radio" value="0")
label(for="msd-mode-radio-flash") Flash
td &nbsp;
+menu_switch_notable("msd-rw-switch", "Writable", false, false)
+menu_switch_notable("msd-rw-switch", "Writable", false, false, "msd-rw-switch")
hr
div(id="msd-storages")
hr
div(class="buttons buttons-row")
button(disabled id="msd-select-new-button" class="row50") Select image to upload
button(disabled id="msd-upload-new-button" class="row25") Upload
button(disabled id="msd-abort-new-button" class="row25") Abort
button(disabled id="msd-select-new-button" class="row50" i18n="kvm_text64") Select image to upload
button(disabled id="msd-upload-new-button" class="row25" i18n="kvm_text65") Upload
button(disabled id="msd-abort-new-button" class="row25" i18n="kvm_text66") Abort
div(id="msd-message-another-user-uploads" class="hidden")
hr
+menu_message("info", "Another user uploads an image")
+menu_message("info", "Another user uploads an image", "msd-message-another-user-uploads")
div(id="msd-new-sub" class="hidden")
hr
table(class="kv")
tr
td Specify a local file:
td(i18n="kvm_text68") Specify a local file:
td #[input(type="file" id="msd-new-file")]
tr
td #[b Or] paste a URL:
td(i18n="kvm_text69") #[b Or] paste a URL:
td #[input(type="text" id="msd-new-url" style="width: 100%")]
tr(id="msd-new-part" class="hidden")
td Upload partition:
td(i18n="kvm_text70") Upload partition:
td(width="100%") #[select(id="msd-new-part-selector")]
hr
table(class="kv")
tr
td(class="value") Note:
td &bull; Don't close the browser page until the upload is complete.
td(class="value" i18n="kvm_text71") Note:
td(i18n="kvm_text72") &bull; Don't close the browser page until the upload is complete.
tr
td
td &bull; To speed up the upload, close the stream window.
td(i18n="kvm_text73") &bull; To speed up the upload, close the stream window.
div(id="msd-uploading-sub" class="hidden")
hr
table(class="kv")
tr
td New image:
td(i18n="kvm_text74") New image:
td(id="msd-uploading-name" class="value")
tr
td Upload size:
td(i18n="kvm_text75") Upload size:
td(id="msd-uploading-size" class="value")
div(class="text")
div(id="msd-uploading-progress" class="progress")
span(id="msd-uploading-progress-value" class="progress-value")
hr
div(class="buttons buttons-row")
button(disabled id="msd-connect-button" class="row50") Connect drive to Server
button(disabled id="msd-disconnect-button" class="row25") Disconnect
button(disabled id="msd-reset-button" class="row25") Reset
button(disabled id="msd-connect-button" class="row50" i18n="kvm_text76") Connect drive to Server
button(disabled id="msd-disconnect-button" class="row25" i18n="kvm_text77") Disconnect
button(disabled id="msd-reset-button" class="row25" i18n="kvm_text78") Reset
2 changes: 1 addition & 1 deletion web/kvm/navbar-shortcuts.pug
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ li(id="shortcuts-dropdown" class="right")
each title, key in sysrq
button(data-shortcut=`AltLeft PrintScreen Key${key}` data-shortcut-confirm="hid-sysrq-ask-switch" class="row16" style="text-align: center;" title=`${title}`) #{key}
hr
+menu_switch("hid-sysrq-ask-switch", "Ask the magic confirmation", true, true)
+menu_switch("hid-sysrq-ask-switch", "Ask the magic confirmation", true, true,"hid-sysrq-ask-switch")
20 changes: 10 additions & 10 deletions web/kvm/navbar-system.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ li(id="system-dropdown" class="right")
data-confirm="Are you sure to send Wake-on-LAN packet to the server?" i18n="kvm_text8") &bull; WoL
hr
div(id="stream-message-no-webrtc" class="hidden")
+menu_message("warning", "WebRTC is not supported by this browser")
+menu_message("warning", "WebRTC is not supported by this browser", "stream-message-no-webrtc")
hr
div(id="stream-message-no-h264" class="hidden")
+menu_message("warning", "H.264 is not supported by this browser")
+menu_message("warning", "H.264 is not supported by this browser", "stream-message-no-h264")
hr
table(class="kv")
tr(id="stream-resolution" class="feature-disabled")
Expand Down Expand Up @@ -85,7 +85,7 @@ li(id="system-dropdown" class="right")
div(class="spoiler")
table(class="kv")
tr
+menu_switch_notable("hid-keyboard-swap-cc-switch", "Swap Left Ctrl and Caps keys", true, false)
+menu_switch_notable("hid-keyboard-swap-cc-switch", "Swap Left Ctrl and Caps keys", true, false, "hid-keyboard-swap-cc-switch")
hr
table(class="kv")
tr
Expand All @@ -97,7 +97,7 @@ li(id="system-dropdown" class="right")
td(class="value-slider") #[input(disabled type="range" id="hid-mouse-sens-slider" class="slider")]
td(id="hid-mouse-sens-value" class="value-number")
tr(id="hid-mouse-squash" class="feature-disabled")
+menu_switch_notable("hid-mouse-squash-switch", "Squash relative moves", true, true)
+menu_switch_notable("hid-mouse-squash-switch", "Squash relative moves", true, true, "hid-mouse-squash-switch")
tr
td(i18n="kvm_text28") Reverse scrolling:
td
Expand All @@ -107,27 +107,27 @@ li(id="system-dropdown" class="right")
td &nbsp;&nbsp;
+menu_switch_notable("hid-mouse-reverse-panning-switch", "X", true, false)
tr
+menu_switch_notable("hid-mouse-cumulative-scrolling-switch", "Cumulative scrolling", true, false)
+menu_switch_notable("hid-mouse-cumulative-scrolling-switch", "Cumulative scrolling", true, false,"hid-mouse-cumulative-scrolling-switch")
tr
td(i18n="kvm_text29") Scroll rate:
td(class="value-slider") #[input(type="range" id="hid-mouse-scroll-slider" class="slider")]
td(id="hid-mouse-scroll-value" class="value-number")
tr
+menu_switch_notable("hid-mouse-dot-switch", "Show the blue dot", true, true)
+menu_switch_notable("hid-mouse-dot-switch", "Show the blue dot", true, true, "hid-mouse-dot-switch")
table(class="kv")
tr(id="hid-connect" class="feature-disabled")
+menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true)
+menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true, "hid-connect-switch")
tr(id="hid-jiggler" class="feature-disabled")
+menu_switch_notable("hid-jiggler-switch", "<a href=\"https://docs.pikvm.org/mouse_jiggler\" target=\"_blank\">Mouse jiggler</a>", false, false)
+menu_switch_notable("hid-jiggler-switch", "<a href=\"https://docs.pikvm.org/mouse_jiggler\" target=\"_blank\">Mouse jiggler</a>", false, false,"hid-jiggler-switch")
tr
+menu_switch_notable("hid-mute-switch", "Mute HID input events", true, false)
+menu_switch_notable("hid-mute-switch", "Mute HID input events", true, false, "hid-mute-switch")
tr(id="v3-usb-breaker" class="feature-disabled")
+menu_switch_notable_gpio("__v3_usb_breaker__", "Connect main USB to Server",
"Turning off this switch will disconnect the main USB<br>from the server. Are you sure you want to continue?")
tr(id="v4-locator" class="feature-disabled")
+menu_switch_notable_gpio("__v4_locator__", "Enable locator LED")
tr
+menu_switch_notable("page-close-ask-switch", "Ask page close confirmation", true, true)
+menu_switch_notable("page-close-ask-switch", "Ask page close confirmation", true, true, "page-close-ask-switch")
hr
div(class="buttons buttons-row")
button(data-force-hide-menu data-show-window="keyboard-window" class="row50" i18n="kvm_text30") &bull; Show keyboard
Expand Down
4 changes: 2 additions & 2 deletions web/kvm/navbar-text.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ li(id="text-dropdown" class="right")
select(id="hid-pak-keymap-selector")
table(class="kv")
tr
+menu_switch_notable("hid-pak-ask-switch", "Ask paste confirmation", true, true)
+menu_switch_notable("hid-pak-ask-switch", "Ask paste confirmation", true, true, "hid-pak-ask-switch")
tr(id="hid-pak-secure" class="feature-disabled")
+menu_switch_notable("hid-pak-secure-switch", "Hide input text", true, false)
+menu_switch_notable("hid-pak-secure-switch", "Hide input text", true, false,"hid-pak-secure-switch")
div(id="stream-ocr" class="feature-disabled")
hr
br
Expand Down
12 changes: 6 additions & 6 deletions web/kvm/navbar.pug
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
mixin navbar_led(id, icon, cls="led-gray")
img(id=id, class=cls src=`${svg_dir}/${icon}.svg`)

mixin menu_message(icon, short, classes="")
mixin menu_message(icon, short, classes="", i18nid)
div(class="text")
table
tr
td(rowspan="2") #[img(class=`sign ${classes}` src=`${svg_dir}/${icon}.svg`)]
td(style="line-height:1.5") #[b #{short}]
td(style="line-height:1.5") #[b(i18n=i18nid) #{short}]
if block
tr
td
Expand All @@ -23,19 +23,19 @@ mixin menu_switch_notable_gpio(channel, title, confirm_off="")
span(class="switch-inner")
span(class="switch")

mixin menu_switch_notable(id, title, enabled, checked)
td !{title}:
mixin menu_switch_notable(id, title, enabled, checked, i18nid)
td(i18n=i18nid) !{title}:
td(align="right")
div(class="switch-box")
input(checked=checked disabled=!enabled type="checkbox" id=id)
label(for=id)
span(class="switch-inner")
span(class="switch")

mixin menu_switch(id, title, enabled, checked)
mixin menu_switch(id, title, enabled, checked, i18nid)
table(class="kv")
tr
+menu_switch_notable(id, title, enabled, checked)
+menu_switch_notable(id, title, enabled, checked, i18nid)

ul(id="navbar")
li(class="left")
Expand Down
12 changes: 6 additions & 6 deletions web/kvm/window-about.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mixin about_tab(name, title, checked=false)
mixin about_tab(name, title, checked=false, i18nid)
- let button_id = `about-tab-${name}-button`
input(checked=checked type="radio" name="about-tab-button", id=button_id)
label(for=button_id) #{title}
label(for=button_id i18n=i18nid) #{title}
div(class="tab")
div(id=`about-${name}` class="code")
if block
Expand All @@ -28,11 +28,11 @@ div(id="about-window" class="window")
| Copyright &copy; 2018-2024 #[a(target="_blank" href="mailto:[email protected]") Maxim Devaev]
br
div(class="tabs-box")
+about_tab("meta", "Meta", true)
+about_tab("hardware", "Hardware")
+about_tab("version", "Version")
+about_tab("meta", "Meta", true, "meta")
+about_tab("hardware", "Hardware", "hardware")
+about_tab("version", "Version", "version")

+about_tab("thanks", "Thanks")
+about_tab("thanks", "Thanks", "thanks")
span(class="code-comment" i18n="kvm_text2")
| // These kind people donated money to the PiKVM project#[br]
| // and supported the work on it. We are very grateful#[br]
Expand Down
2 changes: 1 addition & 1 deletion web/login/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>PiKVM Login</title>
<title>One-KVM Login</title>
<link rel="apple-touch-icon" sizes="180x180" href="/share/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/share/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/share/favicon-16x16.png">
Expand Down
2 changes: 1 addition & 1 deletion web/login/index.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends ../base.pug

append vars
- title = "PiKVM Login"
- title = "One-KVM Login"
- main_js = "login/main"
- css_list = css_list.concat(["window", "modal", "login/login"])

Expand Down
49 changes: 48 additions & 1 deletion web/share/i18n/i18n_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,52 @@
"kvm_text56":"Shortcuts",
"kvm_text57":"Quick keyboard shortcuts<br>",
"kvm_text58":"Also see <i>System &rarr; Show keyboard<i>",
"kvm_text59":"help"
"kvm_text59":"help",

"kvm_text60":"Drive",
"kvm_text61":"Mass Storage Drive:",
"kvm_text62":"Image:",
"kvm_text63":"Drive <a target=\"_blank\" href=\"https://docs.pikvm.org/msd\">mode</a>:",
"kvm_text64":"Select image to upload",
"kvm_text65":"Upload",
"kvm_text66":"Abort",
"kvm_text68":"Specify a local file:",
"kvm_text69":"<b>Or</b> paste a URL:",
"kvm_text70":"Upload partition:",
"kvm_text71":"Note:",
"kvm_text72":"&bull; Don't close the browser page until the upload is complete.",
"kvm_text73":"&bull; To speed up the upload, close the stream window.",
"kvm_text74":"New image:",
"kvm_text75":"Upload size:",
"kvm_text76":"Connect drive to Server",
"kvm_text77":"Disconnect",
"kvm_text78":"Reset",

"atx-ask-switch":"Ask click confirmation",
"hid-recorder-loop-switch":"Infinite loop playback",
"msd-rw-switch":"Writable",
"hid-sysrq-ask-switch":"Ask the magic confirmation",
"hid-keyboard-swap-cc-switch":"Swap Left Ctrl and Caps keys",
"hid-mouse-squash-switch":"Squash relative moves",
"hid-mouse-cumulative-scrolling-switch":"Cumulative scrolling",
"hid-mouse-dot-switch":"Show the blue dot",
"hid-connect-switch":"Connect HID to Server",
"hid-jiggler-switch":"<a href=\"https://docs.pikvm.org/mouse_jiggler\" target=\"_blank\">Mouse jiggler</a>",
"hid-mute-switch":"Mute HID input events",
"page-close-ask-switch":"Ask page close confirmation",
"hid-pak-ask-switch":"Ask paste confirmation",
"hid-pak-secure-switch":"Hide input text",
"meta":"Meta",
"hardware":"Hardware",
"version":"Version",
"thanks":"Thanks",
"stream-message-no-webrtc":"WebRTC is not supported by this browser",
"stream-message-no-h264":"H.264 is not supported by this browser",
"msd-message-offline":"Mass Storage Drive is offline",
"msd-message-image-broken":"Current image is broken!",
"msd-message-too-big-for-cdrom":"Current image is too big for CD-ROM!",
"msd-message-out-of-storage":"Current image is out of storage",
"msd-message-rw-enabled":"Read-write mode is enabled",
"msd-message-downloads":"The image is being downloaded from One-KVM",
"msd-message-another-user-uploads":"Another user uploads an image"
}
Loading

0 comments on commit cb559f5

Please sign in to comment.