params; return match ($message->key) { 'connection.ok' => __('Connection works.', 'domainwarn'), 'connection.ok_organization' => sprintf( /* translators: %s: name of the organization in DomainWarn */ __('Connection works. Organization: %s', 'domainwarn'), (string) ($params['organization'] ?? '') ), 'connection.missing_config' => __('Enter the API token first. Create it in DomainWarn under Settings → API.', 'domainwarn'), 'connection.unauthorized' => __('The API token is not valid or has no write scope.', 'domainwarn'), 'connection.unknown_organization' => __('The token belongs to another organization than the one entered. Leave the slug under Advanced empty, then the plugin uses the one of the token.', 'domainwarn'), 'connection.unreachable' => sprintf( /* translators: %s: reason reported by the network or by DomainWarn */ __('DomainWarn could not be reached: %s', 'domainwarn'), (string) ($params['detail'] ?? '') ), 'connection.failed' => sprintf( /* translators: %d: HTTP status code */ __('DomainWarn answered with an error (HTTP %d).', 'domainwarn'), (int) ($params['status'] ?? 0) ), 'report.reported' => __('Inside view reported.', 'domainwarn'), 'report.not_monitored' => __('Not monitored in DomainWarn yet.', 'domainwarn'), 'report.heartbeat_sent' => __('Heartbeat sent.', 'domainwarn'), 'report.heartbeat_unavailable' => __('No heartbeat available – the plan allows no further checks.', 'domainwarn'), 'report.no_public_address' => __('This site has no address that can be reached from outside.', 'domainwarn'), 'sync.created' => sprintf( /* translators: %s: domain name */ __('Added to monitoring: %s', 'domainwarn'), (string) ($params['name'] ?? '') ), 'sync.existing' => sprintf( /* translators: %s: domain name */ __('Already monitored: %s', 'domainwarn'), (string) ($params['name'] ?? '') ), 'sync.failed' => sprintf( /* translators: 1: domain name, 2: reason */ __('%1$s could not be added: %2$s', 'domainwarn'), (string) ($params['name'] ?? ''), (string) ($params['detail'] ?? '') ), 'sync.summary' => sprintf( /* translators: 1: number added, 2: number already monitored, 3: number failed */ __('%1$d added, %2$d already monitored, %3$d failed.', 'domainwarn'), (int) ($params['created'] ?? 0), (int) ($params['existing'] ?? 0), (int) ($params['failed'] ?? 0) ), 'security_txt.check_ok' => __('Serves the security.txt from DomainWarn itself – the same file DomainWarn hosts, without a redirect.', 'domainwarn'), 'security_txt.check_redirected' => __('Redirects to DomainWarn, and a valid security.txt is waiting there.', 'domainwarn'), 'security_txt.check_outdated' => __('Serves a security.txt, but not the current one from DomainWarn – a page cache probably still holds an older copy. Clear the cache or wait an hour.', 'domainwarn'), 'security_txt.check_target_invalid' => __('DomainWarn has no valid security.txt for this address. Check in DomainWarn that serving is still switched on.', 'domainwarn'), 'security_txt.check_elsewhere' => sprintf( /* translators: %s: address the site redirects to */ __('Redirects somewhere else: %s', 'domainwarn'), (string) ($params['location'] ?? '') ), 'security_txt.check_served' => __('This address already serves a security.txt of its own – a file in the web root or another plugin. DomainWarn does not override it.', 'domainwarn'), 'security_txt.check_shadowed' => __('Something else answers this address as well – a file in the web root or another plugin. So as not to override it silently, the plugin stays out of it until only one of them answers.', 'domainwarn'), 'security_txt.check_missing' => __('There is no security.txt at this address.', 'domainwarn'), 'security_txt.check_unreachable' => sprintf( /* translators: %s: reason reported by the network */ __('The address could not be fetched: %s', 'domainwarn'), (string) ($params['detail'] ?? '') ), default => $message->key, }; } /** * Alle Schlüssel, die diese Klasse kennt – der Test gleicht sie gegen die im Quelltext verwendeten ab. * * @return list */ public static function keys(): array { return [ 'connection.ok', 'connection.ok_organization', 'connection.missing_config', 'connection.unauthorized', 'connection.unknown_organization', 'connection.unreachable', 'connection.failed', 'report.reported', 'report.not_monitored', 'report.heartbeat_sent', 'report.heartbeat_unavailable', 'report.no_public_address', 'sync.created', 'sync.existing', 'sync.failed', 'sync.summary', 'security_txt.check_ok', 'security_txt.check_redirected', 'security_txt.check_outdated', 'security_txt.check_target_invalid', 'security_txt.check_elsewhere', 'security_txt.check_served', 'security_txt.check_shadowed', 'security_txt.check_missing', 'security_txt.check_unreachable', ]; } }