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
+79
-54
@@ -2,6 +2,7 @@
|
||||
// is open on the device being set up. Pure: the set-up sheet (flows/) draws it.
|
||||
|
||||
import type { Kind } from '../shared/types';
|
||||
import { fmt } from '../shared/i18n';
|
||||
|
||||
export type Platform = 'ios' | 'android' | 'windows' | 'mac' | 'linux' | 'unknown';
|
||||
export type AppId = 'vpn' | 'awg' | 'wg';
|
||||
@@ -61,64 +62,67 @@ export interface Store {
|
||||
}
|
||||
|
||||
const GH_CLIENT = 'https://github.com/amnezia-vpn/amnezia-client/releases/latest';
|
||||
const APK: NonNullable<Store['alt']> = {
|
||||
href: GH_CLIENT,
|
||||
top: 'APK file on',
|
||||
const apk = (href: string): NonNullable<Store['alt']> => ({
|
||||
href,
|
||||
top: _('APK file on'),
|
||||
main: 'GitHub',
|
||||
mark: 'github',
|
||||
why: 'The APK is for phones without Google Play, or where the store hides the app.',
|
||||
};
|
||||
why: _('The APK is for phones without Google Play, or where the store hides the app.'),
|
||||
});
|
||||
|
||||
/** Where the app comes from on a platform: the store first, the official GitHub release where no store has it. */
|
||||
export function storeFor(app: AppId, platform: Platform): Store | null {
|
||||
const onAppStore = _('Download on the');
|
||||
const onPlay = _('Get it on');
|
||||
const onGitHub = _('Official release on GitHub');
|
||||
const S: Record<AppId, Partial<Record<Platform, Store>>> = {
|
||||
vpn: {
|
||||
ios: { href: 'https://apps.apple.com/app/amneziavpn/id1600529900', top: 'Download on the', main: 'App Store', mark: 'appstore' },
|
||||
ios: { href: 'https://apps.apple.com/app/amneziavpn/id1600529900', top: onAppStore, main: 'App Store', mark: 'appstore' },
|
||||
android: {
|
||||
href: 'https://play.google.com/store/apps/details?id=org.amnezia.vpn',
|
||||
top: 'Get it on',
|
||||
top: onPlay,
|
||||
main: 'Google Play',
|
||||
mark: 'googleplay',
|
||||
alt: APK,
|
||||
alt: apk(GH_CLIENT),
|
||||
},
|
||||
windows: { href: GH_CLIENT, top: 'Official release on GitHub', main: 'Download for Windows', mark: 'windows' },
|
||||
mac: { href: GH_CLIENT, top: 'Official release on GitHub', main: 'Download for Mac', mark: 'apple' },
|
||||
linux: { href: GH_CLIENT, top: 'Official release on GitHub', main: 'Download for Linux', mark: 'linux' },
|
||||
windows: { href: GH_CLIENT, top: onGitHub, main: _('Download for Windows'), mark: 'windows' },
|
||||
mac: { href: GH_CLIENT, top: onGitHub, main: _('Download for Mac'), mark: 'apple' },
|
||||
linux: { href: GH_CLIENT, top: onGitHub, main: _('Download for Linux'), mark: 'linux' },
|
||||
},
|
||||
awg: {
|
||||
ios: { href: 'https://apps.apple.com/us/app/amneziawg/id6478942365', top: 'Download on the', main: 'App Store', mark: 'appstore' },
|
||||
ios: { href: 'https://apps.apple.com/us/app/amneziawg/id6478942365', top: onAppStore, main: 'App Store', mark: 'appstore' },
|
||||
android: {
|
||||
href: 'https://play.google.com/store/apps/details?id=org.amnezia.awg',
|
||||
top: 'Get it on',
|
||||
top: onPlay,
|
||||
main: 'Google Play',
|
||||
mark: 'googleplay',
|
||||
alt: { ...APK, href: 'https://github.com/amnezia-vpn/amneziawg-android/releases' },
|
||||
alt: apk('https://github.com/amnezia-vpn/amneziawg-android/releases'),
|
||||
},
|
||||
windows: {
|
||||
href: 'https://github.com/amnezia-vpn/amneziawg-windows-client/releases',
|
||||
top: 'Official release on GitHub',
|
||||
main: 'Download for Windows',
|
||||
top: onGitHub,
|
||||
main: _('Download for Windows'),
|
||||
mark: 'windows',
|
||||
},
|
||||
mac: {
|
||||
href: 'https://apps.apple.com/us/app/amneziawg/id6478942365',
|
||||
top: 'Download on the',
|
||||
top: onAppStore,
|
||||
main: 'Mac App Store',
|
||||
mark: 'appstore',
|
||||
},
|
||||
linux: { href: 'https://github.com/amnezia-vpn/amneziawg-tools', top: 'On GitHub', main: 'amneziawg-tools', mark: 'linux' },
|
||||
linux: { href: 'https://github.com/amnezia-vpn/amneziawg-tools', top: _('On GitHub'), main: 'amneziawg-tools', mark: 'linux' },
|
||||
},
|
||||
wg: {
|
||||
ios: { href: 'https://apps.apple.com/app/wireguard/id1441195209', top: 'Download on the', main: 'App Store', mark: 'appstore' },
|
||||
ios: { href: 'https://apps.apple.com/app/wireguard/id1441195209', top: onAppStore, main: 'App Store', mark: 'appstore' },
|
||||
android: {
|
||||
href: 'https://play.google.com/store/apps/details?id=com.wireguard.android',
|
||||
top: 'Get it on',
|
||||
top: onPlay,
|
||||
main: 'Google Play',
|
||||
mark: 'googleplay',
|
||||
},
|
||||
windows: { href: 'https://www.wireguard.com/install/', top: 'Download from', main: 'wireguard.com', mark: 'windows' },
|
||||
mac: { href: 'https://apps.apple.com/app/wireguard/id1451685025', top: 'Download on the', main: 'Mac App Store', mark: 'appstore' },
|
||||
linux: { href: 'https://www.wireguard.com/install/', top: 'Install from', main: 'wireguard.com', mark: 'linux' },
|
||||
windows: { href: 'https://www.wireguard.com/install/', top: _('Download from'), main: 'wireguard.com', mark: 'windows' },
|
||||
mac: { href: 'https://apps.apple.com/app/wireguard/id1451685025', top: onAppStore, main: 'Mac App Store', mark: 'appstore' },
|
||||
linux: { href: 'https://www.wireguard.com/install/', top: _('Install from'), main: 'wireguard.com', mark: 'linux' },
|
||||
},
|
||||
};
|
||||
return S[app][platform] ?? null;
|
||||
@@ -129,12 +133,12 @@ export const routerStore = (app: AppId): Store =>
|
||||
app === 'wg'
|
||||
? {
|
||||
href: 'https://openwrt.org/docs/guide-user/services/vpn/wireguard/start',
|
||||
top: 'OpenWrt packages',
|
||||
top: _('OpenWrt packages'),
|
||||
main: 'wireguard-tools',
|
||||
mark: 'openwrt',
|
||||
}
|
||||
: // One line on a phone: the kernel module goes on top.
|
||||
{ href: 'https://openwrt.org/packages/start', top: 'OpenWrt packages + kmod', main: 'amneziawg-tools', mark: 'openwrt' };
|
||||
{ href: 'https://openwrt.org/packages/start', top: _('OpenWrt packages + kmod'), main: 'amneziawg-tools', mark: 'openwrt' };
|
||||
|
||||
/**
|
||||
* Does AmneziaVPN here open a `vpn://` link? Only the Android app registers the
|
||||
@@ -146,31 +150,45 @@ export const opensKeyLinks = (platform: Platform): boolean => platform === 'andr
|
||||
/** The key as a file for the share sheet: AmneziaVPN on iOS imports `.vpn` files (the key as text). */
|
||||
export const keyFileName = (confName: string): string => `${confName.replace(/\.conf$/i, '')}.vpn`;
|
||||
|
||||
/** A path through an app's menus: its items in order. */
|
||||
const menu = (...items: string[]) => items.join(' → ');
|
||||
|
||||
/*
|
||||
* Inside the app: where the scanner and the importer are, as each platform's
|
||||
* app words it. The WireGuard apps are the same apps as AmneziaWG (it is
|
||||
* their fork), menus included.
|
||||
* Inside the app: where the scanner and the importer are, word for word as
|
||||
* each platform's app labels them, in its own Russian when the page is in
|
||||
* Russian (every one of these apps has it). Checked against the apps'
|
||||
* sources in October 2026: wireguard-apple, wireguard-android and
|
||||
* wireguard-windows, their amneziawg forks (the same apps, menus included)
|
||||
* and amnezia-client. The context keeps the apps' words apart from the
|
||||
* portal's own. AmneziaVPN opens its "Connection" screen from the + in its
|
||||
* bottom bar (no label there); the scanner is on it on phones only.
|
||||
*/
|
||||
const TUNNEL_MENU: Partial<Record<Platform, { file: string; qr?: string }>> = {
|
||||
ios: { file: '+ → Create from file or archive', qr: '+ → Create from QR code' },
|
||||
android: { file: '+ → Import from file or archive', qr: '+ → Scan from QR code' },
|
||||
mac: { file: '+ → Import tunnel(s) from file' },
|
||||
windows: { file: 'Add Tunnel → Import tunnel(s) from file' },
|
||||
};
|
||||
function tunnelMenu(platform: Platform): { file: string; qr?: string } | undefined {
|
||||
const menus: Partial<Record<Platform, { file: string; qr?: string }>> = {
|
||||
ios: { file: menu('+', _('Create from file or archive', 'WireGuard app')), qr: menu('+', _('Create from QR code', 'WireGuard app')) },
|
||||
android: { file: menu('+', _('Import from file or archive', 'WireGuard app')), qr: menu('+', _('Scan from QR code', 'WireGuard app')) },
|
||||
mac: { file: menu('+', _('Import Tunnel(s) from File…', 'WireGuard app')) },
|
||||
windows: { file: menu(_('Add Tunnel', 'WireGuard app'), _('Import tunnel(s) from file…', 'WireGuard app')) },
|
||||
};
|
||||
return menus[platform];
|
||||
}
|
||||
|
||||
/** Where the app scans a code; a phone of either kind gets both wordings. */
|
||||
export function scanPath(app: AppId, platform: Platform = 'unknown'): string {
|
||||
if (app === 'vpn') return 'Add server → Scan QR';
|
||||
const qr = TUNNEL_MENU[platform]?.qr;
|
||||
return qr ?? `${TUNNEL_MENU.ios!.qr} (Android: ${TUNNEL_MENU.android!.qr!.replace(/^.* → /, '')})`;
|
||||
if (app === 'vpn') return menu('+', _('QR code', 'AmneziaVPN app'));
|
||||
const qr = tunnelMenu(platform)?.qr;
|
||||
return qr ?? fmt(_('%s (Android: %s)'), tunnelMenu('ios')!.qr, tunnelMenu('android')!.qr!.replace(/^.* → /, ''));
|
||||
}
|
||||
|
||||
/** Where the app takes a file (AmneziaVPN: the key). */
|
||||
/** Where the app takes a file (AmneziaVPN: the key, pasted by its Insert button); elsewhere, the Android app's words. */
|
||||
export function importPath(app: AppId, platform: Platform = 'unknown'): string {
|
||||
if (app === 'vpn') return 'Add server → Insert key';
|
||||
return TUNNEL_MENU[platform]?.file ?? 'Add tunnel → Import from file';
|
||||
if (app === 'vpn') return menu('+', _('Insert', 'AmneziaVPN app'));
|
||||
return (tunnelMenu(platform) ?? tunnelMenu('android')!).file;
|
||||
}
|
||||
|
||||
/** The last step in AmneziaVPN, once the key is in: its Continue button. */
|
||||
export const vpnContinue = () => fmt(_('Tap “%s” and connect'), _('Continue', 'AmneziaVPN app'));
|
||||
|
||||
/**
|
||||
* The file into the app, step by step: [text, the part in bold]. Linux has no
|
||||
* app, only the tools: the file goes up straight from where it was saved
|
||||
@@ -179,25 +197,22 @@ export function importPath(app: AppId, platform: Platform = 'unknown'): string {
|
||||
export function importSteps(app: AppId, platform: Platform, file: string, shared: boolean): [string, string][] {
|
||||
if (platform === 'linux')
|
||||
return [
|
||||
['Open a terminal in the folder with the file', ''],
|
||||
['Run ', `sudo ${app === 'wg' ? 'wg-quick' : 'awg-quick'} up ./${file}`],
|
||||
[_('Open a terminal in the folder with the file'), ''],
|
||||
// The command comes after the word, in bold: "Run sudo awg-quick up …".
|
||||
[`${_('Run')} `, `sudo ${app === 'wg' ? 'wg-quick' : 'awg-quick'} up ./${file}`],
|
||||
];
|
||||
const path = importPath(app, platform);
|
||||
return [
|
||||
[`Open ${APP_NAME[app]}`, ''],
|
||||
[fmt(_('Open %s', 'step'), APP_NAME[app]), ''],
|
||||
[path.replace(/ → [^→]*$/, ' → '), path.replace(/^.* → /, '')],
|
||||
[shared ? 'Confirm the import and connect' : 'Pick the file and connect', ''],
|
||||
[shared ? _('Confirm the import and connect') : _('Pick the file and connect'), ''],
|
||||
];
|
||||
}
|
||||
|
||||
export const PLATFORM_LABEL: Record<Platform, string> = {
|
||||
ios: 'iPhone / iPad',
|
||||
android: 'Android',
|
||||
windows: 'Windows',
|
||||
mac: 'Mac',
|
||||
linux: 'Linux',
|
||||
unknown: 'this device',
|
||||
};
|
||||
/** The platform in a sentence: its name, or "this device". */
|
||||
export function platformLabel(p: Platform): string {
|
||||
return { ios: 'iPhone / iPad', android: 'Android', windows: 'Windows', mac: 'Mac', linux: 'Linux', unknown: _('this device') }[p];
|
||||
}
|
||||
|
||||
/**
|
||||
* The personal link that opens straight on one device's set-up: the page then
|
||||
@@ -220,6 +235,16 @@ export const wantsAdd = (hash: string): boolean => hash === '#add';
|
||||
/**
|
||||
* "the phone", "the computer": the device being set up, in a sentence. The
|
||||
* sheet's title already names it; the lines under it do not repeat the name.
|
||||
* `on`: the word after "on the" ("open it on the phone"), which other
|
||||
* languages decline (Russian: на телефоне, but на телефон after "to the").
|
||||
*/
|
||||
export const deviceNoun = (kind: Kind): string =>
|
||||
({ phone: 'phone', tablet: 'tablet', computer: 'computer', router: 'router', other: 'device' })[kind];
|
||||
export const deviceNoun = (kind: Kind, on = false): string =>
|
||||
(on
|
||||
? {
|
||||
phone: _('phone', 'on the'),
|
||||
tablet: _('tablet', 'on the'),
|
||||
computer: _('computer', 'on the'),
|
||||
router: _('router', 'on the'),
|
||||
other: _('device', 'on the'),
|
||||
}
|
||||
: { phone: _('phone'), tablet: _('tablet'), computer: _('computer'), router: _('router'), other: _('device') })[kind];
|
||||
Reference in new issue
Block a user