// 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': 'Telegram is not linked',
  'status.connected-as': 'Linked as {handle}',

  // --- Action cards ----------------------------------------------------------
  'card.login.name': 'Sign in with phone',
  'card.login.desc': 'The code arrives in Telegram or via SMS',
  'card.login-qr.name': 'Sign in with QR code',
  'card.login-qr.desc': 'Scan a QR code from the Telegram app on your phone',
  'card.refresh.name': 'Refresh status',
  'card.refresh.desc': 'Re-check whether Telegram is linked',
  'card.refresh.in-flight': 'Checking…',
  'card.logout.name': 'Sign out of Telegram',
  '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 Telegram bot works',
  'card.about.desc': 'Sign-in, security, and source code',
  'about.title': 'About the Telegram bot',
  'about.body-1':
    'This bot connects Telegram to Vojo. After signing in, your Telegram DMs and groups appear in the Vojo chat list, and replies sent from Vojo are delivered to your contacts as regular Telegram messages.',
  'about.body-2':
    'Signing in takes your phone number and a code from Telegram — the same as signing in on a new device. If you use two-step verification, Telegram will additionally ask for your cloud password.',
  'about.body-3':
    'The connection runs through the open-source mautrix-telegram bridge. It creates a Telegram session on the Vojo server and uses it to link Telegram with your Vojo account: receiving messages from Telegram and sending your replies back.',
  'about.github-label': 'The bridge source code is open on GitHub:',
  'about.github-url': 'https://github.com/mautrix/telegram',
  'about.body-4':
    'You can revoke access at any time — with the “Sign out of Telegram” button here, or in Telegram itself under “Settings → Devices”.',
  'about.close': 'Close',
  'about.aria-close': 'Close “About the bot”',

  // --- Phone form ------------------------------------------------------------
  'auth-card.phone.title': 'Phone sign-in',
  'auth-card.phone.label': 'Phone number',
  'auth-card.phone.placeholder': '+79991234567',
  'auth-card.phone.hint': 'SMS delivery can take up to 30 seconds.',
  'auth-card.phone.submit': 'Send code',
  'auth-card.phone.cooldown': 'Retry in {seconds}s',
  'auth-card.phone.invalid': 'The number looks incomplete or mistyped.',

  // --- Code form ---------------------------------------------------------
  'auth-card.code.title': 'Confirmation code',
  'auth-card.code.label': 'Code from Telegram or SMS',
  'auth-card.code.placeholder': '123456',
  'auth-card.code.submit': 'Confirm',
  'auth-card.code.countdown': 'The code should arrive within {seconds}s',
  'auth-card.code.countdown-done': 'Nothing yet — press “Cancel” and try again.',

  // --- 2FA password form -------------------------------------------------
  'auth-card.password.title': 'Telegram cloud password',
  'auth-card.password.hint':
    'Your account has two-step verification enabled. Enter your Telegram cloud password — it is not your Vojo password.',
  'auth-card.password.label': 'Password',
  'auth-card.password.submit': 'Confirm',
  'auth-card.password.show': 'Show',
  'auth-card.password.hide': 'Hide',

  // --- 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': 'QR-code sign-in',
  'auth-card.qr.hint': 'Open Telegram 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 Telegram. 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 “Settings → Devices” in Telegram.',
  'auth-card.qr.step-2': 'Tap “Link Desktop Device” and scan this QR code.',
  'auth-card.qr.step-3': 'If you use a cloud password, you will enter it in the next step.',

  // --- Inline form errors --------------------------------------------------
  'error.code-incorrect': 'Incorrect code. Try again.',
  'error.password-incorrect': 'Incorrect password. Try again.',

  // --- 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.openid-blocked':
    'The host did not grant the widget sign-in permission — the bot is missing the vojo.openid capability in config.json.',
  'error.flood': 'Telegram asks to wait: too many attempts. Try again later.',
  'error.phone-invalid': 'Telegram rejected this number. Check it and try again.',
  'error.phone-banned': 'This number is banned on Telegram.',
  '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': 'Login limit reached. Sign out of the current account first.',
  'error.generic': 'Something went wrong: {reason}',
  'notice.login-success': 'Telegram linked! Your chats will appear in the list within a minute.',
  'notice.logged-out': 'Telegram session ended.',

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

  // --- Account tab -----------------------------------------------------------
  'account.state-bad':
    'The bridge reports a connection problem: {reason}. Try signing out and linking Telegram again.',

  // --- 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 missing from the configuration (experience.provisioningUrl in config.json) or the vojo.openid capability was not granted.',
  'error.retry': 'Retry',

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