Localize term connection and fullscreen button

Also prevent trailing-whitespace-trimming breaking lang and fix derps
box-drawing
cpsdqs 7 years ago
parent f9b11bdc30
commit 4234c70f52
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 6
      dump_js_lang.php
  2. 8
      js/lang.js
  3. 13
      js/term/index.js
  4. 11
      lang/de.php
  5. 38
      lang/en.php

@ -8,6 +8,12 @@ $selected = [
'wifi.connected_ip_is', 'wifi.connected_ip_is',
'wifi.not_conn', 'wifi.not_conn',
'wifi.enter_passwd', 'wifi.enter_passwd',
'term_nav.fullscreen',
'term_conn.connecting',
'term_conn.waiting_content',
'term_conn.disconnected',
'term_conn.waiting_server',
'term_conn.reconnecting'
]; ];
$out = []; $out = [];

@ -2,7 +2,13 @@
let _tr = { let _tr = {
"wifi.connected_ip_is": "Connected, IP is ", "wifi.connected_ip_is": "Connected, IP is ",
"wifi.not_conn": "Not connected.", "wifi.not_conn": "Not connected.",
"wifi.enter_passwd": "Enter password for \":ssid:\"" "wifi.enter_passwd": "Enter password for \":ssid:\"",
"term_nav.fullscreen": "Fullscreen",
"term_conn.connecting": "Connecting",
"term_conn.waiting_content": "Waiting for content",
"term_conn.disconnected": "Disconnected",
"term_conn.waiting_server": "Waiting for server",
"term_conn.reconnecting": "Reconnecting"
}; };
module.exports = function tr (key) { return _tr[key] || '?' + key + '?' } module.exports = function tr (key) { return _tr[key] || '?' + key + '?' }

@ -1,4 +1,5 @@
const { qs, mk } = require('../utils') const { qs, mk } = require('../utils')
const localize = require('../lang')
const Notify = require('../notif') const Notify = require('../notif')
const TermScreen = require('./screen') const TermScreen = require('./screen')
const TermConnection = require('./connection') const TermConnection = require('./connection')
@ -35,11 +36,11 @@ module.exports = function (opts) {
conn.on('open', () => { conn.on('open', () => {
// console.log('*open') // console.log('*open')
showSplash({ title: 'Connecting', loading: true }) showSplash({ title: localize('term_conn.connecting'), loading: true })
}) })
conn.on('connect', () => { conn.on('connect', () => {
// console.log('*connect') // console.log('*connect')
showSplash({ title: 'Waiting for content', loading: true }) showSplash({ title: localize('term_conn.waiting_content'), loading: true })
}) })
conn.on('load', () => { conn.on('load', () => {
// console.log('*load') // console.log('*load')
@ -48,7 +49,7 @@ module.exports = function (opts) {
}) })
conn.on('disconnect', () => { conn.on('disconnect', () => {
// console.log('*disconnect') // console.log('*disconnect')
showSplash({ title: 'Disconnected' }, 500) showSplash({ title: localize('term_conn.disconnected') }, 500)
screen.screen = [] screen.screen = []
screen.screenFG = [] screen.screenFG = []
screen.screenBG = [] screen.screenBG = []
@ -56,12 +57,12 @@ module.exports = function (opts) {
}) })
conn.on('silence', () => { conn.on('silence', () => {
// console.log('*silence') // console.log('*silence')
showSplash({ title: 'Waiting for server', loading: true }, 0) showSplash({ title: localize('term_conn.waiting_server'), loading: true }, 0)
}) })
// conn.on('ping-fail', () => { screen.window.statusScreen = { title: 'Disconnected' } }) // conn.on('ping-fail', () => { screen.window.statusScreen = { title: 'Disconnected' } })
conn.on('ping-success', () => { conn.on('ping-success', () => {
// console.log('*ping-success') // console.log('*ping-success')
showSplash({ title: 'Re-connecting', loading: true }, 0) showSplash({ title: localize('term_conn.reconnecting'), loading: true }, 0)
}) })
conn.init() conn.init()
@ -171,7 +172,7 @@ module.exports = function (opts) {
fullscreenIcon.className = 'icn-resize-full' fullscreenIcon.className = 'icn-resize-full'
button.appendChild(fullscreenIcon) button.appendChild(fullscreenIcon)
let span = mk('span') let span = mk('span')
span.textContent = 'Fullscreen' span.textContent = localize('term_nav.fullscreen')
button.appendChild(span) button.appendChild(span)
qs('#term-nav').insertBefore(button, qs('#term-nav').firstChild) qs('#term-nav').insertBefore(button, qs('#term-nav').firstChild)

@ -31,6 +31,7 @@ return [
'title.term' => 'Terminal', // page title of the terminal page 'title.term' => 'Terminal', // page title of the terminal page
'term_nav.fullscreen' => 'Vollbild',
'term_nav.config' => 'Konfiguration', 'term_nav.config' => 'Konfiguration',
'term_nav.wifi' => 'WLAN', 'term_nav.wifi' => 'WLAN',
'term_nav.help' => 'Hilfe', 'term_nav.help' => 'Hilfe',
@ -40,6 +41,12 @@ return [
'term_nav.keybd' => 'Tastatur', 'term_nav.keybd' => 'Tastatur',
'term_nav.paste_prompt' => 'Text einfügen zum Versenden:', 'term_nav.paste_prompt' => 'Text einfügen zum Versenden:',
'term_conn.connecting' => 'Verbinden',
'term_conn.waiting_content' => 'Warten auf Inhalt',
'term_conn.disconnected' => 'Nicht verbunden',
'term_conn.waiting_server' => 'Warten auf Server',
'term_conn.reconnecting' => 'Verbinden',
// Terminal settings page // Terminal settings page
'term.defaults' => 'Anfangseinstellungen', 'term.defaults' => 'Anfangseinstellungen',
@ -162,9 +169,9 @@ return [
'pwlock.title' => 'Zugriffsbeschränkungen', 'pwlock.title' => 'Zugriffsbeschränkungen',
'pwlock.explain' => ' 'pwlock.explain' => '
Manche, oder alle Teile Web-Interface können mit einem Passwort geschützt werden. Manche, oder alle Teile des Web-Interface können mit einem Passwort geschützt werden.
Lass die Passwortfelder leer wenn du es sie verändern möchtest.<br> Lass die Passwortfelder leer wenn du es sie verändern möchtest.<br>
Das voreingestellte Passwort ist "%def_access_pw%".". Das voreingestellte Passwort ist "%def_access_pw%".
', ',
'pwlock.region' => 'Geschützte Seiten', 'pwlock.region' => 'Geschützte Seiten',
'pwlock.region.none' => 'Keine, alles offen', 'pwlock.region.none' => 'Keine, alles offen',

@ -31,6 +31,7 @@ return [
'title.term' => 'Terminal', // page title of the terminal page 'title.term' => 'Terminal', // page title of the terminal page
'term_nav.fullscreen' => 'Fullscreen',
'term_nav.config' => 'Config', 'term_nav.config' => 'Config',
'term_nav.wifi' => 'WiFi', 'term_nav.wifi' => 'WiFi',
'term_nav.help' => 'Help', 'term_nav.help' => 'Help',
@ -40,14 +41,18 @@ return [
'term_nav.keybd' => 'Keyboard', 'term_nav.keybd' => 'Keyboard',
'term_nav.paste_prompt' => 'Paste text to send:', 'term_nav.paste_prompt' => 'Paste text to send:',
'term_conn.connecting' => 'Connecting',
'term_conn.waiting_content' => 'Waiting for content',
'term_conn.disconnected' => 'Disconnected',
'term_conn.waiting_server' => 'Waiting for server',
'term_conn.reconnecting' => 'Reconnecting',
// Terminal settings page // Terminal settings page
'term.defaults' => 'Initial Settings', 'term.defaults' => 'Initial Settings',
'term.expert' => 'Expert Options', 'term.expert' => 'Expert Options',
'term.explain_initials' => ' 'term.explain_initials' => '
Those are the initial settings used after ESPTerm powers on, or when the screen Those are the initial settings used after ESPTerm powers on, or when the screen reset command is received (<code>\ec</code>). They can be changed by the terminal application using escape sequences.
reset command is received (<code>\ec</code>). They can be changed by the
terminal application using escape sequences.
', ',
'term.explain_expert' => ' 'term.explain_expert' => '
Those are advanced config options that usually don\'t need to be changed. Those are advanced config options that usually don\'t need to be changed.
@ -56,9 +61,7 @@ return [
'term.example' => 'Default colors preview', 'term.example' => 'Default colors preview',
'term.explain_scheme' => ' 'term.explain_scheme' => '
To select default text and background color, click on the To select default text and background color, click on the preview palette. Alternatively, use numbers 0-15 for theme colors, 16-255 for standard colors and hex (#FFFFFF) for True Color (24-bit).
preview palette. Alternatively, use numbers 0-15 for theme colors, 16-255 for standard
colors and hex (#FFFFFF) for True Color (24-bit).
', ',
'term.fgbg_presets' => 'Defaults Presets', 'term.fgbg_presets' => 'Defaults Presets',
@ -152,15 +155,10 @@ return [
'wificonn.back_to_config' => 'Back to WiFi config', 'wificonn.back_to_config' => 'Back to WiFi config',
'wificonn.telemetry_lost' => 'Telemetry lost; something went wrong, or your device disconnected.', 'wificonn.telemetry_lost' => 'Telemetry lost; something went wrong, or your device disconnected.',
'wificonn.explain_android_sucks' => ' 'wificonn.explain_android_sucks' => '
If you\'re configuring ESPTerm via a smartphone, or were connected If you\'re configuring ESPTerm via a smartphone, or were connected from another external network, your device may lose connection and this progress indicator won\'t work. Please wait a while (~ 15 seconds), then check if the connection succeeded.',
from another external network, your device may lose connection and this
progress indicator won\'t work. Please wait a while (~ 15 seconds),
then check if the connection succeeded.',
'wificonn.explain_reset' => ' 'wificonn.explain_reset' => '
To force enable the built-in AP, hold the BOOT To force enable the built-in AP, hold the BOOT button until the blue LED starts flashing. Hold the button longer (until the LED flashes rapidly) for a "factory reset".',
button until the blue LED starts flashing. Hold the button longer (until the LED
flashes rapidly) for a "factory reset".',
'wificonn.disabled' =>"Station mode is disabled.", 'wificonn.disabled' =>"Station mode is disabled.",
'wificonn.idle' =>"Idle, not connected and has no IP.", 'wificonn.idle' =>"Idle, not connected and has no IP.",
@ -192,11 +190,7 @@ return [
'adminpw.title' => 'Change Admin Password', 'adminpw.title' => 'Change Admin Password',
'adminpw.explain' => 'adminpw.explain' =>
' '
The "admin password" is used to manipulate the stored default settings The "admin password" is used to manipulate the stored default settings and to change access restrictions. This password is not saved as part of the main config, i.e. using save / restore does not affect this password. When the admin password is forgotten, the easiest way to re-gain access is to wipe and re-flash the chip.<br>
and to change access restrictions. This password is not saved as part
of the main config, i.e. using save / restore does not affect this
password. When the admin password is forgotten, the easiest way to
re-gain access is to wipe and re-flash the chip.<br>
The default admin password is "%def_admin_pw%". The default admin password is "%def_admin_pw%".
', ',
'adminpw.new_admin_pw' => 'New admin password', 'adminpw.new_admin_pw' => 'New admin password',
@ -226,8 +220,7 @@ return [
'uart.title' => 'Serial Port Parameters', 'uart.title' => 'Serial Port Parameters',
'uart.explain' => ' 'uart.explain' => '
This form controls the communication UART. The debug UART is fixed This form controls the communication UART. The debug UART is fixed at 115.200 baud, one stop-bit and no parity.
at 115.200 baud, one stop-bit and no parity.
', ',
'uart.baud' => 'Baud rate', 'uart.baud' => 'Baud rate',
'uart.parity' => 'Parity', 'uart.parity' => 'Parity',
@ -243,10 +236,7 @@ return [
'hwtuning.title' => 'Hardware Tuning', 'hwtuning.title' => 'Hardware Tuning',
'hwtuning.explain' => ' 'hwtuning.explain' => '
ESP8266 can be overclocked from 80&nbsp;MHz to 160&nbsp;MHz. ESP8266 can be overclocked from 80&nbsp;MHz to 160&nbsp;MHz. This will make it more responsive and allow faster screen updates at the expense of slightly higher power consumption. This can also make it more susceptible to interference. Use with care.
This will make it more responsive and allow faster screen updates
at the expense of slightly higher power consumption. This can also make
it more susceptible to interference. Use with care.
', ',
'hwtuning.overclock' => 'Overclock to 160MHz', 'hwtuning.overclock' => 'Overclock to 160MHz',

Loading…
Cancel
Save