Dawnline 0.11.0
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
- Russian translation. The admin pages, the LuCI menu and the router's messages (errors, Health checks, update steps, the service log) come in Russian with the new luci-i18n-dawnline-ru package, released beside the app. LuCI shows it when its language is Russian, or "auto" with a Russian browser - The translation installs with install.sh when LuCI is in Russian (or with --lang ru), follows every Dawnline update and rollback, and can be added or removed in Components → Dawnline → Translation - The portal speaks the visitor's language: it opens in the system's language and switches between English and Russian in place, from the language pill beside its QR code. It carries its own translation and needs no package - Set-up steps quote the apps' own menus word for word, in Russian too: AmneziaVPN is "+ → Insert → Continue" (it has no "Add server"), and the Mac and Windows menus of WireGuard and AmneziaWG have their real names - Questions in the portal (Reconnect, Remove) read from the left edge and close with Cancel, without × - Numbers, sizes and dates follow the page's language. A server that can't start says why in one sentence; event details and service log lines read as whole sentences - README in Russian (README_ru.md). rules/i18n.md: how strings are written and translated; CI checks the catalogs (npm run i18n:check)
This commit is contained in:
1 parent
caed976e63
commit
2f2aaf6c34
173 files changed
+25645
-2823
No files matched your search
@@ -3,6 +3,7 @@
|
||||
// stays for the replay, and the replay's timeline and shimmer. No DOM here (see ./render).
|
||||
|
||||
import type { GeoPoint, LogEvent } from '../../shared/types';
|
||||
import { locale } from '../../shared/i18n';
|
||||
|
||||
/** On one client address: from a connect or a roam to the next one, a disconnect or now. */
|
||||
export interface Stretch {
|
||||
@@ -219,14 +220,14 @@ export function ticks(range: '24h' | '7d' | '30d', now: number): [number, string
|
||||
} else if (range === '7d') {
|
||||
d.setHours(12, 0, 0, 0);
|
||||
for (; d.getTime() / 1000 <= now; d.setDate(d.getDate() + 1))
|
||||
put(d.getTime() / 1000, d.toLocaleDateString('en-GB', { weekday: 'short' }));
|
||||
put(d.getTime() / 1000, d.toLocaleDateString(locale(), { weekday: 'short' }));
|
||||
} else {
|
||||
const end = new Date(now * 1000);
|
||||
end.setHours(0, 0, 0, 0);
|
||||
for (let i = 0; i < 5; i++) {
|
||||
const w = new Date(end);
|
||||
w.setDate(end.getDate() - 7 * i);
|
||||
put(w.getTime() / 1000, w.toLocaleDateString('en-GB', { day: 'numeric', month: 'short' }));
|
||||
put(w.getTime() / 1000, w.toLocaleDateString(locale(), { day: 'numeric', month: 'short' }));
|
||||
}
|
||||
out.reverse();
|
||||
}
|
||||
@@ -234,12 +235,12 @@ export function ticks(range: '24h' | '7d' | '30d', now: number): [number, string
|
||||
}
|
||||
|
||||
/** "14:05", local. */
|
||||
export const clock = (ts: number) => new Date(ts * 1000).toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' });
|
||||
export const clock = (ts: number) => new Date(ts * 1000).toLocaleTimeString(locale(), { hour: '2-digit', minute: '2-digit' });
|
||||
|
||||
/** "Today", "Yesterday" or "Wed 14 Oct" for a moment, against the router's `now`. */
|
||||
export function dayName(ts: number, now: number): string {
|
||||
const day = (x: number) => new Date(x * 1000).toDateString();
|
||||
if (day(ts) === day(now)) return 'Today';
|
||||
if (day(ts) === day(now - 86400)) return 'Yesterday';
|
||||
return new Date(ts * 1000).toLocaleDateString('en-GB', { weekday: 'short', day: 'numeric', month: 'short' });
|
||||
if (day(ts) === day(now)) return _('Today');
|
||||
if (day(ts) === day(now - 86400)) return _('Yesterday');
|
||||
return new Date(ts * 1000).toLocaleDateString(locale(), { weekday: 'short', day: 'numeric', month: 'short' });
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import type { Device, Geo, LogEvent, Person } from '../../shared/types';
|
||||
import { E } from '../e';
|
||||
import { icon } from '../../shared/icons';
|
||||
import { ago } from '../../shared/format';
|
||||
import { fmt } from '../../shared/i18n';
|
||||
import { devicePlaces, type ConnectionMap, type MapData, type Range } from '../map';
|
||||
import {
|
||||
MOVE_MS,
|
||||
@@ -63,7 +64,7 @@ export class PlacesView {
|
||||
private endTimer = 0;
|
||||
private play = E('button', { type: 'button', class: 'dl-map-btn' });
|
||||
private chip = E('span', { class: 'dl-map-chip' });
|
||||
private stop = E('button', { type: 'button', class: 'dl-map-btn', title: 'Back to now', 'aria-label': 'Back to now' }, icon('x'));
|
||||
private stop = E('button', { type: 'button', class: 'dl-map-btn', title: _('Back to now'), 'aria-label': _('Back to now') }, icon('x'));
|
||||
private reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;
|
||||
|
||||
constructor(
|
||||
@@ -137,13 +138,13 @@ export class PlacesView {
|
||||
const row = E('div', { class: 'dl-dplace-row' }, [
|
||||
E('span', { class: `dl-dplace-n${x.online ? ' live' : ''}` }, x.online ? icon(d.device.kind) : String(x.n)),
|
||||
E('span', { class: 'dl-row-main dl-stack' }, [
|
||||
E('span', {}, [x.city || x.cc || 'Unknown city', x.org ? E('span', { class: 'dl-muted' }, ` · ${x.org}`) : '']),
|
||||
E('span', {}, [x.city || x.cc || _('Unknown city'), x.org ? E('span', { class: 'dl-muted' }, ` · ${x.org}`) : '']),
|
||||
E('span', { class: 'dl-faint' }, [
|
||||
E('span', { class: 'dl-mono' }, x.ip),
|
||||
sh != null ? ` · ${sh > 0 && sh < 0.005 ? '<1' : Math.round(sh * 100)}% of the time` : '',
|
||||
sh != null ? ` · ${fmt(_('%s%% of the time'), sh > 0 && sh < 0.005 ? '<1' : Math.round(sh * 100))}` : '',
|
||||
]),
|
||||
]),
|
||||
E('span', { class: x.online ? 'dl-dplace-now' : 'dl-faint dl-nowrap' }, x.online ? 'now' : ago(x.ts, d.now)),
|
||||
E('span', { class: x.online ? 'dl-dplace-now' : 'dl-faint dl-nowrap' }, x.online ? _('now') : ago(x.ts, d.now)),
|
||||
strip,
|
||||
]);
|
||||
row.addEventListener('mouseenter', () => this.map.hoverPlace(key));
|
||||
@@ -173,14 +174,14 @@ export class PlacesView {
|
||||
)
|
||||
: '',
|
||||
]
|
||||
: E('div', { class: 'dl-sub' }, 'No locations in this period.'),
|
||||
: E('div', { class: 'dl-sub' }, _('No locations in this period.')),
|
||||
);
|
||||
this.paintControls();
|
||||
}
|
||||
|
||||
private paintControls() {
|
||||
dom.content(this.play, icon(this.playing ? 'pause' : 'play'));
|
||||
this.play.title = this.playing ? 'Pause' : 'Replay this period';
|
||||
this.play.title = this.playing ? _('Pause', 'replay') : _('Replay this period');
|
||||
this.play.setAttribute('aria-label', this.play.title);
|
||||
// LuCI's dom.content takes one level of children: no nested arrays.
|
||||
dom.content(this.controls, this.on ? [this.play, this.chip, this.stop] : this.st.length > 1 ? [this.play] : []);
|
||||
|
||||
Reference in new issue
Block a user