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
@@ -1,34 +1,44 @@
|
||||
// What the demo adds to the breadcrumb: the scenario chip right after the path,
|
||||
// and a GitHub pill just before the page's QR knob (at the end where there is
|
||||
// none: a card alone). On a phone the pill would crowd out the names, so it
|
||||
// and a GitHub pill just before the page's language picker (none over a card
|
||||
// alone, which has no picker either). On a phone the pill would crowd out the names, so it
|
||||
// gives way to a button in the scenario drawer (demo.css). The portal redraws
|
||||
// the breadcrumb with the page and knows nothing of either, so both go back in
|
||||
// place after each redraw.
|
||||
// place after each redraw; a language change makes both again in it.
|
||||
|
||||
import { h, ic } from '../dom';
|
||||
import { onLang } from '../i18n';
|
||||
import { REPO } from './data';
|
||||
import { scenarioChip } from './picker';
|
||||
import type { DemoRouter } from './router';
|
||||
|
||||
export function mountCrumbs(router: DemoRouter) {
|
||||
const app = document.getElementById('app')!;
|
||||
const chip = scenarioChip(router);
|
||||
const gh = h(
|
||||
'a',
|
||||
{ class: 'dm-gh', href: REPO, target: '_blank', rel: 'noopener', 'aria-label': 'Dawnline on GitHub' },
|
||||
ic('github'),
|
||||
h('span', {}, 'GitHub'),
|
||||
);
|
||||
const make = () => ({
|
||||
chip: scenarioChip(router),
|
||||
gh: h(
|
||||
'a',
|
||||
{ class: 'dm-gh', href: REPO, target: '_blank', rel: 'noopener', 'aria-label': _('Dawnline on GitHub') },
|
||||
ic('github'),
|
||||
h('span', {}, 'GitHub'),
|
||||
),
|
||||
});
|
||||
let { chip, gh } = make();
|
||||
// Our own insertions call this again: by then both are in place and nothing moves.
|
||||
const keep = () => {
|
||||
const crumbs = app.querySelector('.crumbs');
|
||||
const path = crumbs?.querySelector('.cr-path');
|
||||
if (!crumbs || !path) return;
|
||||
if (path.nextElementSibling !== chip) path.after(chip);
|
||||
const qr = crumbs.querySelector('.cr-qr');
|
||||
if (qr && qr.previousElementSibling !== gh) qr.before(gh);
|
||||
else if (!qr && crumbs.lastElementChild !== gh) crumbs.append(gh);
|
||||
const lang = crumbs.querySelector('.cr-lang');
|
||||
if (lang && lang.previousElementSibling !== gh) lang.before(gh);
|
||||
};
|
||||
new MutationObserver(keep).observe(app, { childList: true, subtree: true });
|
||||
keep();
|
||||
// The page has redrawn its breadcrumb in the new language by now (main.ts listens first).
|
||||
onLang(() => {
|
||||
chip.remove();
|
||||
gh.remove();
|
||||
({ chip, gh } = make());
|
||||
keep();
|
||||
});
|
||||
}
|
||||
+24
-28
@@ -19,35 +19,31 @@ export interface Scenario {
|
||||
about: string;
|
||||
}
|
||||
|
||||
/** What can be tried, in the picker's groups. */
|
||||
export const GROUPS: { title: string; items: Scenario[] }[] = [
|
||||
{
|
||||
title: 'Your page',
|
||||
items: [
|
||||
{ id: 'normal', label: 'Everything works', about: 'Three devices: one online, one waiting to be set up.' },
|
||||
{ id: 'first', label: 'First visit', about: 'A fresh link with no devices yet.' },
|
||||
{ id: 'stale', label: 'Settings changed', about: 'The admin changed something: a device needs an update.' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Stopped by the admin',
|
||||
items: [
|
||||
{ id: 'quota', label: 'Out of data', about: 'The month’s limit is used up.' },
|
||||
{ id: 'hours', label: 'Outside allowed hours', about: 'Access only at certain hours of the day.' },
|
||||
{ id: 'paused', label: 'Paused by the admin', about: 'The page turns into one card.' },
|
||||
{ id: 'expired', label: 'Access ended', about: 'The end date has passed.' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Other cases',
|
||||
items: [
|
||||
{ id: 'http', label: 'Opened over plain HTTP', about: 'Settings only travel over HTTPS.' },
|
||||
{ id: 'plain', label: 'Plain WireGuard', about: 'Disguise off: any WireGuard app connects.' },
|
||||
{ id: 'full', label: 'No free slots', about: 'Every device slot is taken.' },
|
||||
],
|
||||
},
|
||||
/** What can be tried, in the picker's groups (their words are groups()). */
|
||||
const GROUPS: ScenarioId[][] = [
|
||||
['normal', 'first', 'stale'],
|
||||
['quota', 'hours', 'paused', 'expired'],
|
||||
['http', 'plain', 'full'],
|
||||
];
|
||||
export const SCENARIOS: Scenario[] = GROUPS.flatMap((g) => g.items);
|
||||
export const SCENARIOS: { id: ScenarioId }[] = GROUPS.flat().map((id) => ({ id }));
|
||||
|
||||
/** The picker's groups in the page's language: made when it draws (the language changes in place). */
|
||||
export function groups(): { title: string; items: Scenario[] }[] {
|
||||
const titles = [_('Your page'), _('Stopped by the admin'), _('Other cases')];
|
||||
const words: Record<ScenarioId, [label: string, about: string]> = {
|
||||
normal: [_('Everything works'), _('Three devices: one online, one waiting to be set up.')],
|
||||
first: [_('First visit'), _('A fresh link with no devices yet.')],
|
||||
stale: [_('Settings changed'), _('The admin changed something: a device needs an update.')],
|
||||
quota: [_('Out of data'), _('The month’s limit is used up.')],
|
||||
hours: [_('Outside allowed hours'), _('Access only at certain hours of the day.')],
|
||||
paused: [_('Paused by the admin'), _('The page turns into one card.')],
|
||||
expired: [_('Access ended'), _('The end date has passed.')],
|
||||
http: [_('Opened over plain HTTP'), _('Settings only travel over HTTPS.')],
|
||||
plain: [_('Plain WireGuard'), _('Disguise off: any WireGuard app connects.')],
|
||||
full: [_('No free slots'), _('Every device slot is taken.')],
|
||||
};
|
||||
return GROUPS.map((ids, i) => ({ title: titles[i], items: ids.map((id) => ({ id, label: words[id][0], about: words[id][1] })) }));
|
||||
}
|
||||
export const isScenario = (id: unknown): id is ScenarioId => SCENARIOS.some((s) => s.id === id);
|
||||
|
||||
/** A device as the demo keeps it; the page's Device is made from it on every answer. */
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Dawnline\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "A fresh link with no devices yet."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Access ended"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Access only at certain hours of the day."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/crumbs.ts
|
||||
msgid "Dawnline on GitHub"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "Demo"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/main.ts
|
||||
msgid "Demo keys connect nowhere"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Disguise off: any WireGuard app connects."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Every device slot is taken."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Everything works"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "First visit"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "How the page looks in each case. Nothing here connects."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "No free slots"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Opened over plain HTTP"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Other cases"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Out of data"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Outside allowed hours"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Paused by the admin"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Plain WireGuard"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Settings changed"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Settings only travel over HTTPS."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "Start over"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Stopped by the admin"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The admin changed something: a device needs an update."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "The demo started over"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The end date has passed."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The month’s limit is used up."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The page turns into one card."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Three devices: one online, one waiting to be set up."
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "Try a scenario"
|
||||
msgstr ""
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Your page"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,129 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Dawnline\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Language-Team: Russian\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "A fresh link with no devices yet."
|
||||
msgstr "Новая ссылка, устройств пока нет."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Access ended"
|
||||
msgstr "Доступ закончился"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Access only at certain hours of the day."
|
||||
msgstr "Доступ только в определённые часы."
|
||||
|
||||
#: web/src/portal/demo/crumbs.ts
|
||||
msgid "Dawnline on GitHub"
|
||||
msgstr "Dawnline на GitHub"
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "Demo"
|
||||
msgstr "Демо"
|
||||
|
||||
#: web/src/portal/demo/main.ts
|
||||
msgid "Demo keys connect nowhere"
|
||||
msgstr "Демо-ключи никуда не подключаются"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Disguise off: any WireGuard app connects."
|
||||
msgstr "Маскировка выключена: подойдёт любое приложение WireGuard."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Every device slot is taken."
|
||||
msgstr "Все места для устройств заняты."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Everything works"
|
||||
msgstr "Всё работает"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "First visit"
|
||||
msgstr "Первый визит"
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "How the page looks in each case. Nothing here connects."
|
||||
msgstr "Как выглядит страница в каждом случае. Ничего не подключается по-настоящему."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "No free slots"
|
||||
msgstr "Нет свободных мест"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Opened over plain HTTP"
|
||||
msgstr "Открыто по обычному HTTP"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Other cases"
|
||||
msgstr "Другие случаи"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Out of data"
|
||||
msgstr "Трафик закончился"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Outside allowed hours"
|
||||
msgstr "Вне часов доступа"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Paused by the admin"
|
||||
msgstr "Доступ на паузе"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Plain WireGuard"
|
||||
msgstr "Обычный WireGuard"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Settings changed"
|
||||
msgstr "Настройки изменились"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Settings only travel over HTTPS."
|
||||
msgstr "Настройки передаются только по HTTPS."
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "Start over"
|
||||
msgstr "Начать заново"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Stopped by the admin"
|
||||
msgstr "Ограничения администратора"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The admin changed something: a device needs an update."
|
||||
msgstr "Администратор что-то поменял: устройство нужно обновить."
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "The demo started over"
|
||||
msgstr "Демо началось заново"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The end date has passed."
|
||||
msgstr "Дата окончания прошла."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The month’s limit is used up."
|
||||
msgstr "Месячный лимит исчерпан."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "The page turns into one card."
|
||||
msgstr "Страница сворачивается в одну карточку."
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Three devices: one online, one waiting to be set up."
|
||||
msgstr "Три устройства: одно в сети, одно ждёт настройки."
|
||||
|
||||
#: web/src/portal/demo/picker.ts
|
||||
msgid "Try a scenario"
|
||||
msgstr "Выберите сценарий"
|
||||
|
||||
#: web/src/portal/demo/data.ts
|
||||
msgid "Your page"
|
||||
msgstr "Ваша страница"
|
||||
@@ -4,11 +4,16 @@
|
||||
// picker.ts). The order of the imports is the boot order: the router owns
|
||||
// fetch before the portal loads.
|
||||
|
||||
// First: the translation globals, before anything draws.
|
||||
import { addCatalog } from '../i18n';
|
||||
import ru from './i18n/ru.po';
|
||||
import { router } from './serve';
|
||||
import '../main';
|
||||
import { toast } from '../ui/feedback';
|
||||
import { mountCrumbs } from './crumbs';
|
||||
|
||||
// The demo's own words (the scenarios, its chip and toasts), beside the portal's.
|
||||
addCatalog('ru', ru);
|
||||
mountCrumbs(router);
|
||||
|
||||
// An AmneziaVPN key would add a server that connects nowhere to the visitor's app: the demo keeps it on the page.
|
||||
@@ -18,7 +23,7 @@ document.addEventListener(
|
||||
if (!(e.target as Element).closest?.('a[href^="vpn:"]')) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
toast('Demo keys connect nowhere', true);
|
||||
toast(_('Demo keys connect nowhere'), true);
|
||||
},
|
||||
true,
|
||||
);
|
||||
@@ -11,7 +11,7 @@ import { closeSheet, head, openSheet, sub, type View } from '../ui/sheet';
|
||||
import { glass, type Tone } from '../ui/glass';
|
||||
import { toast } from '../ui/feedback';
|
||||
import { EASE_OUT, play } from '../motion';
|
||||
import { GROUPS, REPO, type Scenario, type ScenarioId } from './data';
|
||||
import { REPO, groups, type Scenario, type ScenarioId } from './data';
|
||||
import type { DemoRouter } from './router';
|
||||
|
||||
/** Each scenario's glass icon and tone (the glass set is smaller than the line icons). */
|
||||
@@ -75,9 +75,9 @@ export function scenarioChip(router: DemoRouter): HTMLElement {
|
||||
const el = h(
|
||||
'div',
|
||||
{ class: 'view' },
|
||||
head('Try a scenario'),
|
||||
sub('How the page looks in each case. Nothing here connects.'),
|
||||
...GROUPS.map((g) =>
|
||||
head(_('Try a scenario')),
|
||||
sub(_('How the page looks in each case. Nothing here connects.')),
|
||||
...groups().map((g) =>
|
||||
h('div', { class: 'dm-group' }, h('div', { class: 'lbl-s' }, g.title), h('div', { class: 'dm-list' }, ...g.items.map(row))),
|
||||
),
|
||||
h(
|
||||
@@ -85,20 +85,20 @@ export function scenarioChip(router: DemoRouter): HTMLElement {
|
||||
{ class: 'dm-foot' },
|
||||
h(
|
||||
'button',
|
||||
{ type: 'button', class: 'btn soft', onclick: () => pick(router.scenario(), 'The demo started over') },
|
||||
{ type: 'button', class: 'btn soft', onclick: () => pick(router.scenario(), _('The demo started over')) },
|
||||
ic('reset'),
|
||||
h('span', {}, 'Start over'),
|
||||
h('span', {}, _('Start over')),
|
||||
),
|
||||
h('a', { class: 'btn soft dm-gh-alt', href: REPO, target: '_blank', rel: 'noopener' }, ic('github'), h('span', {}, 'GitHub')),
|
||||
),
|
||||
);
|
||||
return { el, label: 'Try a scenario' };
|
||||
return { el, label: _('Try a scenario') };
|
||||
}
|
||||
|
||||
return h(
|
||||
'button',
|
||||
{ type: 'button', class: 'dm-chip', 'aria-haspopup': 'dialog', onclick: () => openSheet(scenarios) },
|
||||
h('span', {}, 'Demo'),
|
||||
h('span', {}, _('Demo')),
|
||||
ic('chevron', 'i'),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user