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' });
|
||||
}
|
||||
Reference in new issue
Block a user