// English fallback. Mirror the RU key set; `Record<StringKey, string>` enforces
// that every RU key has an EN counterpart at compile time.

import type { StringKey } from './ru';

export const EN: Record<StringKey, string> = {
  // --- Status pill ---------------------------------------------------------
  'status.checking': 'Checking status…',
  'status.disconnected': 'WhatsApp is not linked',
  'status.connected-as': 'Linked as {handle}',

  // --- Action cards ----------------------------------------------------------
  'card.login.name': 'Sign in by phone number',
  'card.login.desc': 'Enter your number and get an 8-character code for WhatsApp',
  'card.login-qr.name': 'Sign in with QR code',
  'card.login-qr.desc': 'Scan a QR code from the WhatsApp mobile app',
  'card.refresh.name': 'Refresh status',
  'card.refresh.desc': 'Re-check whether WhatsApp is linked',
  'card.refresh.in-flight': 'Checking…',
  'card.logout.name': 'Sign out of WhatsApp',
  'card.logout.desc': 'End the session on this account',
  'card.logout.confirm-prompt': 'Sign out for real?',
  'card.logout.confirm-yes': 'Sign out',
  'card.logout.confirm-no': 'Cancel',

  // --- About panel -----------------------------------------------------------
  'card.about.name': 'How the WhatsApp bot works',
  'card.about.desc': 'How it works and the risks — tap to read',
  'warning.title': 'Important before linking WhatsApp',
  'warning.body-1':
    'Mautrix-whatsapp connects to your account through the same linked-device mechanism as WhatsApp Web. Technically a standard API — but unlike other messengers, WhatsApp’s terms of service explicitly forbid connecting through third-party clients, and Meta may ban your account for it.',
  'warning.tos-label': 'WhatsApp terms of service:',
  'warning.tos-url': 'https://www.whatsapp.com/legal/terms-of-service',
  'about.title': 'About the WhatsApp bot',
  'about.body-1':
    'This bot connects WhatsApp to Vojo. After sign-in, your private chats and groups from WhatsApp will appear in Vojo’s chat list, and replies from the Vojo app will be sent to your contacts as normal WhatsApp messages.',
  'about.body-2':
    'Sign-in requires the WhatsApp mobile app on a phone with an active account. You can either scan a QR code via Settings → Linked devices → Link a device, or enter an 8-character pairing code via Settings → Linked devices → Link with phone number.',
  'about.body-3':
    'The connection runs through the open-source mautrix-whatsapp bridge. It creates a WhatsApp session on the Vojo server and uses it to connect WhatsApp with your Vojo account: receive messages from WhatsApp and send your replies back. Your WhatsApp account keeps working on your phone as usual — the bridge connects in parallel as another linked device.',
  'about.github-label': 'The bridge source code is public on GitHub:',
  'about.github-url': 'https://github.com/mautrix/whatsapp',
  'about.body-4':
    'You can revoke access at any time — with the “Sign out of WhatsApp” button here, or in WhatsApp itself under Settings → Linked devices → Log out from all devices.',
  'about.close': 'Close',
  'about.aria-close': 'Close “About the bot”',

  // --- Phone form (pairing-code flow) -----------------------------------------
  'auth-card.phone.title': 'Sign in by phone number',
  'auth-card.phone.label': 'Phone number',
  'auth-card.phone.placeholder': '+79991234567',
  'auth-card.phone.hint':
    'Enter your number with the country code. WhatsApp will then create an 8-character code to enter in the app.',
  'auth-card.phone.submit': 'Get the code',
  'auth-card.phone.cooldown': 'Retry in {seconds} s',
  'auth-card.phone.invalid': 'The number looks incomplete or mistyped.',

  // --- Pairing-code panel --------------------------------------------------
  'auth-card.pairing-code.title': 'Enter this code in WhatsApp',
  'auth-card.pairing-code.hint':
    'Open WhatsApp on your phone and enter this code under Linked devices → Link with phone number.',
  'auth-card.pairing-code.aria': 'WhatsApp sign-in code. Enter it in the app on your phone.',
  'auth-card.pairing-code.countdown': '{minutes}:{seconds} left to enter the code',
  'auth-card.pairing-code.expired': 'The sign-in window expired. Press “Cancel” and try again.',
  'auth-card.pairing-code.step-1': 'Open WhatsApp on your phone.',
  'auth-card.pairing-code.step-2': 'Go to Settings → Linked devices.',
  'auth-card.pairing-code.step-3': 'Tap “Link a device → Link with phone number”.',
  'auth-card.pairing-code.step-4': 'Enter this code and confirm the sign-in on your phone.',
  'auth-card.pairing-code.copy': 'Copy the code',
  'auth-card.pairing-code.copied': 'Copied',

  // --- Shared form chrome ------------------------------------------------
  'auth-card.cancel': 'Cancel',
  'auth-card.waiting-hint': 'The bridge is still thinking… replies can take up to 30 seconds.',

  // --- QR panel ------------------------------------------------------------
  'auth-card.qr.title': 'Sign in with QR code',
  'auth-card.qr.hint': 'Open WhatsApp on your phone and scan this QR code.',
  'auth-card.qr.preparing': 'Preparing the QR code…',
  'auth-card.qr.aria': 'QR code for signing in to WhatsApp. Scan it with your phone.',
  'auth-card.qr.countdown': '{minutes}:{seconds} left to scan',
  'auth-card.qr.expired': 'The sign-in window expired. Press “Cancel” and try again.',
  'auth-card.qr.step-1': 'Open WhatsApp on your phone.',
  'auth-card.qr.step-2': 'Go to Settings → Linked devices.',
  'auth-card.qr.step-3': 'Tap “Link a device” and scan this QR code.',

  // --- Global errors / notices ---------------------------------------------
  'error.network': 'No connection to the server. Check your internet and try again.',
  'error.auth':
    'Could not verify your account with the bridge. Reload the page; if that does not help, try again later.',
  'error.not-logged-in':
    'The WhatsApp session is no longer active. Go back and link the account again.',
  'error.openid-blocked':
    'The host did not grant the widget sign-in permission — the bot in config.json is missing the vojo.openid capability.',
  'error.rate-limited': 'WhatsApp asks to wait: too many code requests. Try again later.',
  'error.phone-invalid':
    'WhatsApp rejected this number. Enter it in international format and try again.',
  'error.multidevice':
    'WhatsApp multi-device is not enabled on your phone. Update the WhatsApp app and try again.',
  'error.client-outdated':
    'The bridge is outdated and WhatsApp refuses its connection. Tell the Vojo administrator.',
  'error.pair-failed': 'WhatsApp did not confirm the pairing. Start the sign-in over.',
  'error.login-timeout': 'The sign-in window expired. Start over.',
  'error.login-restart': 'The sign-in session was lost. Start over.',
  'error.too-many-logins': 'Linked-account limit reached. Sign out of the current one first.',
  'error.generic': 'Something went wrong: {reason}',
  'notice.login-success': 'WhatsApp is linked! Chats will appear in the list within a minute.',
  'notice.logged-out': 'WhatsApp session ended.',

  // --- Contacts ------------------------------------------------------------
  'card.contacts.name': 'Contacts',
  'card.contacts.desc': 'Your WhatsApp address book: search by name or number',
  'contacts.back': 'Back',
  'contacts.search-placeholder': 'Name or +number…',
  'contacts.hint':
    'These are the contacts from your WhatsApp address book. Pick who to start a chat with in Vojo — the rest are not going anywhere.',
  'contacts.loading': 'Loading contacts…',
  'contacts.error': 'Could not load contacts.',
  'contacts.retry': 'Retry',
  'contacts.empty': 'Your WhatsApp address book is empty so far.',
  'contacts.empty-filtered': 'Nobody found with that name.',
  'contacts.start-chat': 'Start chat',
  'contacts.open-chat': 'Open chat',
  'contacts.creating': 'Creating chat…',
  'contacts.opening': 'Opening…',
  'contacts.probe-check': 'Check {handle} on WhatsApp',
  'contacts.probe-checking': 'Checking {handle}…',
  'contacts.probe-not-found': '{handle} was not found on WhatsApp.',
  'contacts.probe-found': 'Found them! You can start a chat.',
  'contacts.probe-self': 'That is your own number.',
  'contacts.refresh': 'Refresh list',

  // --- Account tab -----------------------------------------------------------
  'account.state-bad':
    'The bridge reports a connection problem: {reason}. Try signing out and linking WhatsApp again.',
  'account.state-transient':
    'The bridge temporarily lost the connection to WhatsApp. Check that your phone is online — it usually recovers on its own.',

  // --- Boot / config ---------------------------------------------------------
  'boot.connecting': 'Connecting to the bridge…',
  'config.missing.title': 'Server-side setup required',
  'config.missing.body':
    'The widget talks to the bridge API, but its address is not configured (experience.provisioningUrl in config.json) or the vojo.openid permission is missing.',
  'error.retry': 'Retry',

  // --- Bootstrap failure -------------------------------------------------
  'bootstrap.failed': 'The widget failed to start',
  'bootstrap.missing-params': 'Required URL parameters are missing: {names}.',
  'bootstrap.embedded-only': 'This page is meant to be embedded by Vojo at the {route} route.',
};
