partial cz translation, improvd lang funcs

box-drawing
Ondřej Hruška 7 years ago
parent 4e65c57529
commit 4c42230a44
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 22
      base.php
  2. 14
      dump_js_lang.php
  3. 19
      lang/common.php
  4. 255
      lang/cs.php
  5. 16
      lang/de.php
  6. 16
      lang/en.php
  7. 2
      sass/app.scss

@ -62,6 +62,8 @@ APS
define('LOCALE', isset($_GET['locale']) ? $_GET['locale'] : (getenv('ESP_LANG') ?: 'en')); define('LOCALE', isset($_GET['locale']) ? $_GET['locale'] : (getenv('ESP_LANG') ?: 'en'));
$_messages = require(__DIR__ . '/lang/' . LOCALE . '.php'); $_messages = require(__DIR__ . '/lang/' . LOCALE . '.php');
$_messages_fallback = require(__DIR__ . '/lang/en.php');
$_messages_common = require(__DIR__ . '/lang/common.php');
$_pages = require(__DIR__ . '/_pages.php'); $_pages = require(__DIR__ . '/_pages.php');
define('APP_NAME', 'ESPTerm'); define('APP_NAME', 'ESPTerm');
@ -97,12 +99,26 @@ function je($s)
function tr($key) function tr($key)
{ {
global $_messages; global $_messages, $_messages_fallback, $_messages_common;
if (isset($_messages[$key])) return $_messages[$key];
else { if (isset($_messages[$key])) {
$str = $_messages[$key];
}
else if (isset($_messages_fallback[$key])) {
$str = $_messages_fallback[$key];
}
else if (isset($_messages_common[$key])) {
$str = $_messages_common[$key];
}
else{
ob_end_clean(); ob_end_clean();
die('??' . $key . '??'); die('??' . $key . '??');
} }
// allow tildes in translation
$str = preg_replace('/(?<=[^ \\\\])~(?=[^ ])/', '&nbsp;', $str);
$str = str_replace('\~', '~', $str);
return $str;
} }
/** Like eval, but allows <?php and ?> */ /** Like eval, but allows <?php and ?> */

@ -8,17 +8,17 @@ $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_nav.fullscreen',
'term_conn.connecting', 'term_conn.connecting',
'term_conn.waiting_content', 'term_conn.waiting_content',
'term_conn.disconnected', 'term_conn.disconnected',
'term_conn.waiting_server', 'term_conn.waiting_server',
'term_conn.reconnecting' 'term_conn.reconnecting'
]; ];
$out = []; $out = [];
foreach ($selected as $key) { foreach ($selected as $key) {
$out[$key] = $_messages[$key]; $out[$key] = tr($key);
} }
file_put_contents(__DIR__. '/js/lang.js', file_put_contents(__DIR__. '/js/lang.js',

@ -0,0 +1,19 @@
<?php
return [
'appname' => 'ESPTerm',
'appname_demo' => 'ESPTerm<sup> DEMO</sup>',
// not used - api etc. Added to suppress warnings
'menu.term_set' => '',
'menu.wifi_connstatus' => '',
'menu.wifi_set' => '',
'menu.wifi_scan' => '',
'menu.network_set' => '',
'menu.system_set' => '',
'menu.write_defaults' => '',
'menu.restore_defaults' => '',
'menu.restore_hard' => '',
'menu.reset_screen' => '',
'menu.index' => '',
];

@ -0,0 +1,255 @@
<?php
return [
'menu.cfg_wifi' => 'Nastavení WiFi',
'menu.cfg_network' => 'Nastavení sítě',
'menu.cfg_term' => 'Nastavení terminalu',
'menu.about' => 'About',
'menu.help' => 'Nápověda',
'menu.term' => 'Zpět k terminálu',
'menu.cfg_system' => 'Nastavení systému',
'menu.cfg_wifi_conn' => 'Připojování',
'menu.settings' => 'Nastavení',
// Terminal page
'title.term' => 'Terminál', // page title of the terminal page
'term_nav.fullscreen' => 'Celá obr.',
'term_nav.config' => 'Nastavení',
'term_nav.wifi' => 'WiFi',
'term_nav.help' => 'Nápověda',
'term_nav.about' => 'About',
'term_nav.paste' => 'Vložit',
'term_nav.upload' => 'Nahrát',
'term_nav.keybd' => 'Klávesnice',
'term_nav.paste_prompt' => 'Vložte text k~odeslání:',
'term_conn.connecting' => 'Připojuji se',
'term_conn.waiting_content' => 'Čekám na data',
'term_conn.disconnected' => 'Odpojen',
'term_conn.waiting_server' => 'Čekám na server',
'term_conn.reconnecting' => 'Obnova spojení',
// Terminal settings page
'term.defaults' => 'Výchozí nastavení',
'term.expert' => 'Pokročilé volby',
'term.explain_initials' => '
Tato nastavení jsou použita po spuštění a při resetu obrazovky
(příkaz RIS, <code>\ec</code>). Tyto volby lze měnit za běhu
pomocí řídicích sekvencí.
',
'term.explain_expert' => '
Interní parametry terminálu. Změnou časování lze dosáhnout kratší
latence a~rychlejšího překreslování, hodnoty záleží na konkrétní
aplikaci. Timeout parseru je čas do automatického zrušení započaté
řídicí sekvence.',
'term.example' => 'Náhled výchozích barev',
'term.explain_scheme' => '
Výchozí barvu textu a pozadí vyberete kliknutím na barvy v~paletě.
Dále lze použít ANSI barvy 0-255 a hex ve formátu #FFFFFF.
',
'term.fgbg_presets' => 'Předvolby výchozích<br>barev textu a pozadí',
'term.color_scheme' => 'Barevné schéma',
'term.reset_screen' => 'Resetovat obrazovku a parser',
'term.term_title' => 'Nadpis',
'term.term_width' => 'Šířka',
'term.term_height' => 'Výška',
'term.buttons' => 'Text tlačítke',
'term.theme' => 'Barevná paleta',
'term.cursor_shape' => 'Styl kurzoru',
'term.parser_tout_ms' => 'Timeout parseru',
'term.display_tout_ms' => 'Prodleva překreslení',
'term.display_cooldown_ms' => 'Min. čas překreslení',
'term.allow_decopt_12' => 'Povolit \e?12h/l',
'term.fn_alt_mode' => 'SS3 Fx klávesy',
'term.show_config_links' => 'Menu pod obrazovkou',
'term.show_buttons' => 'Zobrazit tlačítka',
'term.loopback' => 'Loopback (<span style="text-decoration:overline">SRM</span>)',
'term.crlf_mode' => 'Enter = CR+LF (LNM)',
'term.want_all_fn' => 'Zachytávat F5, F11, F12',
'term.button_msgs' => 'Reporty tlačítek<br>(dek. ASCII CSV)',
'term.color_fg' => 'Výchozí text',
'term.color_bg' => 'Výchozí pozadí',
'term.color_fg_prev' => 'Barva textu',
'term.color_bg_prev' => 'Barva pozadí',
'term.colors_preview' => '',
'cursor.block_blink' => 'Blok, blikající',
'cursor.block_steady' => 'Blok, stálý',
'cursor.underline_blink' => 'Podtržítko, blikající',
'cursor.underline_steady' => 'Podtržítko, stálé',
'cursor.bar_blink' => 'Svislice, blikající',
'cursor.bar_steady' => 'Svislice, stálá',
// Network config page
'net.explain_sta' => '
Odškrtněte "Použít dynamickou IP" pro nastavení statické IP adresy.',
'net.explain_ap' => '
Tato nastavení ovlivňují interní DHCP server v AP režimu (hotspot).',
'net.ap_dhcp_time' => 'Doba zapůjčení adresy',
'net.ap_dhcp_start' => 'Začátek IP poolu',
'net.ap_dhcp_end' => 'Konec IP poolu',
'net.ap_addr_ip' => 'Vlastní IP adresa',
'net.ap_addr_mask' => 'Maska podsítě',
'net.sta_dhcp_enable' => 'Použít dynamickou IP',
'net.sta_addr_ip' => 'Statická IP modulu',
'net.sta_addr_mask' => 'Maska podsítě',
'net.sta_addr_gw' => 'Gateway',
'net.ap' => 'DHCP server (AP)',
'net.sta' => 'DHCP klient',
'net.sta_mac' => 'MAC adresa klienta',
'net.ap_mac' => 'MAC adresa AP',
'net.details' => 'MAC adresy',
// Wifi config page
'wifi.ap' => 'Vlastní hotspot (AP)',
'wifi.sta' => 'Připojení k~externí síti',
'wifi.enable' => 'Zapnuto',
'wifi.tpw' => 'Vysílací výkon',
'wifi.ap_channel' => 'WiFi kanál',
'wifi.ap_ssid' => 'Jméno hotspotu',
'wifi.ap_password' => 'Přístupové heslo',
'wifi.ap_hidden' => 'Skrýt síť',
'wifi.sta_info' => 'Zvolená síť',
'wifi.not_conn' => 'Nepřipojen.',
'wifi.sta_none' => 'Žádná',
'wifi.sta_active_pw' => '🔒 Heslo uloženo',
'wifi.sta_active_nopw' => '🔓 Bez hesla',
'wifi.connected_ip_is' => 'Připojen, IP: ',
'wifi.sta_password' => 'Heslo:',
'wifi.scanning' => 'Hledám sítě',
'wifi.scan_now' => 'Klikněte pro vyhledání sítí!',
'wifi.cant_scan_no_sta' => 'Klikněte pro zapnutí režimu klienta a vyhledání sítí!',
'wifi.select_ssid' => 'Dostupné sítě:',
'wifi.enter_passwd' => 'Zadejte heslo pro ":ssid:"',
'wifi.sta_explain' => 'Vyberte síť a připojte se tlačítkem vpravo nahoře.',
// Wifi connecting status page
'wificonn.status' => 'Stav:',
'wificonn.back_to_config' => 'Zpět k~nastavení WiFi',
'wificonn.telemetry_lost' => 'Telemetry lost; something went wrong, or your device disconnected.',
'wificonn.explain_android_sucks' => '
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.',
'wificonn.explain_reset' => '
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".',
'wificonn.disabled' =>"Station mode is disabled.",
'wificonn.idle' =>"Idle, not connected and has no IP.",
'wificonn.success' => "Connected! Received IP ",
'wificonn.working' => "Connecting to selected AP",
'wificonn.fail' => "Connection failed, check settings & try again. Cause: ",
// Access restrictions form
'pwlock.title' => 'Access Restrictions',
'pwlock.explain' => '
Some parts, or all of the web interface can be protected by a password prompt.
Leave the new password fields empty if you do not wish to change it.<br>
The default password is "%def_access_pw%".
',
'pwlock.region' => 'Protected pages',
'pwlock.region.none' => 'None, all open',
'pwlock.region.settings_noterm' => 'WiFi, Net & System settings',
'pwlock.region.settings' => 'All settings pages',
'pwlock.region.menus' => 'This entire menu section',
'pwlock.region.all' => 'Everything, even terminal',
'pwlock.new_access_pw' => 'New password',
'pwlock.new_access_pw2' => 'Repeat',
'pwlock.admin_pw' => 'Admin password',
'pwlock.access_name' => 'Username',
// Setting admin password
'adminpw.title' => 'Change Admin Password',
'adminpw.explain' =>
'
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>
The default admin password is "%def_admin_pw%".
',
'adminpw.new_admin_pw' => 'New admin password',
'adminpw.new_admin_pw2' => 'Repeat',
'adminpw.old_admin_pw' => 'Old admin password',
// Persist form
'persist.title' => 'Save & Restore',
'persist.explain' => '
ESPTerm saves all settings in Flash. The active settings can be copied to
the "defaults area" and restored later using the blue button below.
',
'persist.confirm_restore' => 'Restore all settings to their default values?',
'persist.confirm_restore_hard' =>
'Restore to firmware default settings? This will reset ' .
'all active settings and switch to AP mode with the default SSID.',
'persist.confirm_store_defaults' =>
'Enter admin password to confirm you want to overwrite the default settings.',
'persist.password' => 'Admin password:',
'persist.restore_defaults' => 'Reset to saved defaults',
'persist.write_defaults' => 'Save active settings as defaults',
'persist.restore_hard' => 'Reset active settings to factory defaults',
'persist.restore_hard_explain' =>
'(This clears the WiFi config! Does not affect saved defaults or admin password.)',
// UART settings form
'uart.title' => 'Serial Port Parameters',
'uart.explain' => '
This form controls the communication UART. The debug UART is fixed
at 115.200 baud, one stop-bit and no parity.
',
'uart.baud' => 'Baud rate',
'uart.parity' => 'Parity',
'uart.parity.none' => 'None',
'uart.parity.odd' => 'Odd',
'uart.parity.even' => 'Even',
'uart.stop_bits' => 'Stop-bits',
'uart.stop_bits.one' => 'One',
'uart.stop_bits.one_and_half' => 'One and half',
'uart.stop_bits.two' => 'Two',
// HW tuning form
'hwtuning.title' => 'Hardware Tuning',
'hwtuning.explain' => '
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.
',
'hwtuning.overclock' => 'Overclock to 160MHz',
// Generic button / dialog labels
'apply' => 'Apply!',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'yes' => 'Yes',
'no' => 'No',
'confirm' => 'OK',
'form_errors' => 'Validation errors for:',
];

@ -1,9 +1,6 @@
<?php <?php
return [ return [
'appname' => 'ESPTerm',
'appname_demo' => 'ESPTerm<sup> DEMO</sup>',
'menu.cfg_wifi' => 'WLAN-Einstellungen', 'menu.cfg_wifi' => 'WLAN-Einstellungen',
'menu.cfg_network' => 'Netzwerkeinstellungen', 'menu.cfg_network' => 'Netzwerkeinstellungen',
'menu.cfg_term' => 'Terminaleinstellungen', 'menu.cfg_term' => 'Terminaleinstellungen',
@ -14,19 +11,6 @@ return [
'menu.cfg_wifi_conn' => 'Verbinden mit dem Netzwerk', 'menu.cfg_wifi_conn' => 'Verbinden mit dem Netzwerk',
'menu.settings' => 'Einstellungen', 'menu.settings' => 'Einstellungen',
// not used - api etc. Added to suppress warnings
'menu.term_set' => '',
'menu.wifi_connstatus' => '',
'menu.wifi_set' => '',
'menu.wifi_scan' => '',
'menu.network_set' => '',
'menu.system_set' => '',
'menu.write_defaults' => '',
'menu.restore_defaults' => '',
'menu.restore_hard' => '',
'menu.reset_screen' => '',
'menu.index' => '',
// Terminal page // Terminal page
'title.term' => 'Terminal', // page title of the terminal page 'title.term' => 'Terminal', // page title of the terminal page

@ -1,9 +1,6 @@
<?php <?php
return [ return [
'appname' => 'ESPTerm',
'appname_demo' => 'ESPTerm<sup> DEMO</sup>',
'menu.cfg_wifi' => 'WiFi Settings', 'menu.cfg_wifi' => 'WiFi Settings',
'menu.cfg_network' => 'Network Settings', 'menu.cfg_network' => 'Network Settings',
'menu.cfg_term' => 'Terminal Settings', 'menu.cfg_term' => 'Terminal Settings',
@ -14,19 +11,6 @@ return [
'menu.cfg_wifi_conn' => 'Connecting to Network', 'menu.cfg_wifi_conn' => 'Connecting to Network',
'menu.settings' => 'Settings', 'menu.settings' => 'Settings',
// not used - api etc. Added to suppress warnings
'menu.term_set' => '',
'menu.wifi_connstatus' => '',
'menu.wifi_set' => '',
'menu.wifi_scan' => '',
'menu.network_set' => '',
'menu.system_set' => '',
'menu.write_defaults' => '',
'menu.restore_defaults' => '',
'menu.restore_hard' => '',
'menu.reset_screen' => '',
'menu.index' => '',
// Terminal page // Terminal page
'title.term' => 'Terminal', // page title of the terminal page 'title.term' => 'Terminal', // page title of the terminal page

@ -7,7 +7,7 @@
@import "utils"; @import "utils";
$form-label-w: 180px; $form-label-w: 220px;
$form-label-gap: 8px; $form-label-gap: 8px;
$form-field-w: 250px; $form-field-w: 250px;

Loading…
Cancel
Save