// English — canonical locale. Other locales inherit key names from this file.
export default {
  // Brand name: kept in English across locales.
  'brand': 'WebBrain',

  // --- Sidepanel ---------------------------------------------------------
  'sp.status.disconnected': 'Disconnected',
  'sp.status.connected': 'Connected ({model})',
  'sp.status.error': 'Error: {msg}',
  'sp.status.failed': 'Connection failed',
  'sp.btn.verbose': 'Toggle verbose tool log',
  'sp.record.stop': 'Stop',
  'sp.record.banner_label': 'Recording',
  'sp.record.error': 'Recording error: {error}',
  'sp.record.saved': 'Saved {filename} to Downloads.',
  'sp.record.transcribing': 'Transcribing audio with Whisper…',
  'sp.record.transcribed': 'Transcript saved: {filename}',
  'sp.record.transcribe_failed': 'Transcription failed: {error}',
  'sp.record.summarize': 'Summarize',
  'sp.btn.language': 'Language',
  'sp.btn.settings': 'Settings',
  'sp.btn.clear': 'New conversation (clear history)',
  'sp.btn.send': 'Send',
  'sp.btn.stop.title': 'Stop agent',
  'sp.btn.stop.label': 'Stop',

  'sp.inspection': 'WebBrain started inspecting this page',

  'sp.greeting.html': 'Hi! I\'m <strong>WebBrain</strong>. I can read this page, answer questions, click buttons, fill forms, and automate multi-step tasks.',
  'sp.greeting.hint': 'Try: "Summarize this page" or "Find all links about pricing"',
  'sp.help_message': 'How can I help with this page?',
  'sp.cleared_message': 'Conversation cleared. How can I help?',

  'sp.mode.ask': 'Ask',
  'sp.mode.ask.title': 'Ask questions about the page — no changes made',
  'sp.mode.act': 'Act',
  'sp.mode.act.title': 'Let WebBrain click, type, and navigate for you',
  'sp.mode.act.warning': 'Act mode: WebBrain will interact with pages on your behalf. Use at your own risk.',
  'sp.mode.act.confirm': 'Act mode lets WebBrain click, type, scroll, and navigate on your behalf.\n\nIt runs inside your authenticated browser session, so it has the same access as you do on every site you\'re logged into.\n\nWatch what it does and stop it any time with the ◼ button.\n\nContinue?',

  'sp.input.ask_placeholder': 'Ask anything about this page...',
  'sp.input.act_placeholder': 'Tell me what to do on this page...',

  'sp.activity.thinking': 'Thinking...',
  'sp.activity.thinking_step': 'Thinking (step {step})...',
  'sp.activity.continuing': 'Continuing...',
  'sp.activity.stopping': 'Stopping...',

  'sp.copy': 'Copy',
  'sp.copied': 'Copied!',
  'sp.copy.code.title': 'Copy code',

  'sp.error_prefix': 'Error: {msg}',
  'sp.stopped_by_user': '[Stopped by user]',
  'sp.stopped_by_user_html': '<em>Stopped by user.</em>',

  'sp.continue_bar': 'Reached the step limit ({steps} steps). Want me to keep going?',
  'sp.continue_btn': 'Continue',

  'sp.clarify.submit': 'Send',
  'sp.clarify.input_placeholder': 'Type your answer…',
  'sp.clarify.input_placeholder_with_options': 'Or type a different answer…',
  'sp.clarify.your_answer': 'Your answer:',

  'sp.step.details': 'details',
  'sp.step.input_label': 'Input',
  'sp.step.result_label': 'Result',

  'sp.api.enabled_html': '🔓 <strong>API mutations enabled</strong> for this conversation. The agent may now use POST/PUT/PATCH/DELETE via fetch_url and execute_js when it judges API to be more reliable than UI for a step. UI-first remains the default. This flag clears when you reset the conversation.',
  'sp.api.badge_html': '<span>🔓 API mutations allowed</span>',

  // --- Tool labels -------------------------------------------------------
  'tool.read_page': 'Reading page',
  'tool.get_interactive_elements': 'Scanning interactive elements',
  'tool.click': 'Clicking',
  'tool.type_text': 'Typing',
  'tool.scroll': 'Scrolling',
  'tool.navigate': 'Navigating',
  'tool.extract_data': 'Extracting data',
  'tool.wait_for_element': 'Waiting for element',
  'tool.get_selection': 'Reading selection',
  'tool.execute_js': 'Running script',
  'tool.new_tab': 'Opening new tab',
  'tool.screenshot': 'Taking screenshot',
  'tool.done': 'Finishing up',
  'tool.click.selector': 'Clicking "{selector}"',
  'tool.click.index': 'Clicking element #{index}',
  'tool.type_text.text': 'Typing "{text}"',
  'tool.navigate.url': 'Going to {url}',
  'tool.new_tab.url': 'Opening {url}',
  'tool.scroll.direction': 'Scrolling {direction}',
  'tool.extract_data.type': 'Extracting {type}',
  'tool.wait_for_element.selector': 'Waiting for "{selector}"',

  // --- Settings ----------------------------------------------------------
  'st.title': 'WebBrain Settings',
  'st.subtitle': 'Configure your LLM providers and display preferences · v{version}',
  'st.tab.display': 'Display',
  'st.tab.providers': 'Providers',
  'st.tab.vision': 'Vision',
  'st.tab.profile': 'Profile',
  'st.tab.account': 'Account',
  'st.tab.captcha': 'CAPTCHA',

  'st.account.not_signed_in': 'Not signed in',
  'st.account.sign_in': 'Sign In / Register',
  'st.account.sign_out': 'Sign Out',
  'st.account.provider_name': 'WebBrain Cloud',

  'st.display.language.label': 'Language',
  'st.display.language.desc': 'Interface language for the WebBrain plugin.',
  'st.display.verbose.label': 'Verbose Mode',
  'st.display.verbose.desc': 'Show full tool call details, arguments, and raw JSON results. Off by default for a cleaner chat experience.',
  'st.display.screenshot.label': 'Screenshot Fallback',
  'st.display.screenshot.desc': 'Capture a screenshot of the page when DOM reading fails or returns insufficient content. Requires a vision-capable model.',
  'st.display.site_adapters.label': 'Site adapters',
  'st.display.site_adapters.desc': 'Inject short, hand-curated guidance for known high-traffic sites (GitHub, Gmail, Stripe, AWS, etc.) into the agent\'s first message. Helps the agent avoid common dead-ends. Adds a small token cost on the first turn of conversations on matched sites.',
  'st.display.auto_screenshot.label': 'Auto-screenshot',
  'st.display.auto_screenshot.desc': 'Automatically capture a viewport screenshot after the agent acts on the page, so vision-capable models can see what changed. Costs more tokens. Disabled silently if the active model doesn\'t support images.',
  'st.display.auto_screenshot.off': 'Off',
  'st.display.auto_screenshot.navigation': 'On navigation',
  'st.display.auto_screenshot.state_change': 'On state change (default)',
  'st.display.auto_screenshot.every_step': 'Every step',
  'st.display.tracing.label': 'Record traces (for model comparison)',
  'st.display.tracing.desc_html': 'Persist every run (LLM requests, responses, tool calls, screenshots) into local IndexedDB so you can inspect and compare models side-by-side. Opens in a separate Traces tab. Off by default because it adds disk writes per step. <a href="traces.html" target="_blank" style="color:var(--accent);">Open Traces page →</a>',
  'st.display.strict_secret.label': 'Strict secret handling',
  'st.display.strict_secret.desc': 'Refuse to quote credentials (passwords, API keys, tokens, OTPs) in summaries or assistant text — even when you explicitly ask for them. Useful if you regularly share trace files or screen-share. Off by default: webbrain runs in your own browser, so by default the agent shows you values you ask for and just keeps `done` summaries tidy.',
  'st.display.allow_local_network.label': 'Allow agent to access local network',
  'st.display.allow_local_network.desc': 'Lets the agent\'s fetch_url tool reach loopback (127.0.0.1, localhost) and private/RFC1918 addresses (10.x, 192.168.x, 172.16–31.x). Useful for local dev servers, intranet tools, or self-hosted APIs. Off by default — when off, prompt-injected pages can\'t steer the agent into probing your local network. Cloud-metadata addresses (169.254.169.254) and *.internal/*.local hostnames stay blocked even when on.',
  'st.display.notify_sound.label': 'Completion sound',
  'st.display.notify_sound.desc': 'Play a short chime in the side panel when the agent finishes a task. Won\'t play if you cancel the run.',
  'st.display.max_steps.label': 'Max Agent Steps',
  'st.display.max_steps.desc': 'Maximum number of tool-use steps the agent can take per message. Higher values allow more complex multi-step tasks but may use more tokens.',
  'st.display.traces_link.label': 'Traces',
  'st.display.traces_link.desc': 'Inspect recorded runs side-by-side. Only available when tracing is on.',
  'st.display.traces_link.open': 'Open Traces →',

  'st.providers.info.html': '<strong>Getting started with llama.cpp:</strong><br>Run <code>llama-server -m your-model.gguf --port 8080</code> to start a local server.<br>No API key needed — it runs entirely on your machine.',
  'st.providers.filter.all': 'All',
  'st.providers.filter.local': 'Local',
  'st.providers.filter.cloud': 'Cloud',
  'st.providers.filter.router': 'Router',
  'st.providers.filter.empty': 'No providers in this category. Switch the filter to "All" to see everything.',
  'st.providers.save': 'Save',
  'st.providers.test': 'Test Connection',
  'st.providers.set_active': 'Set Active',
  'st.providers.active': 'ACTIVE',
  'st.providers.saved': 'Saved!',
  'st.providers.testing': 'Testing...',
  'st.providers.connected': 'Connected! Model: {model}',
  'st.providers.unknown_model': 'unknown',
  'st.providers.failed': 'Failed: {error}',
  'st.providers.load_models': 'Load models',
  'st.providers.loading': 'Loading…',
  'st.providers.models_loaded': '{count} models loaded',
  'st.providers.get_api_key': 'Get API key',

  'st.provider.field.server_url': 'Server URL',
  'st.provider.field.api_base_url': 'API Base URL',
  'st.provider.field.api_key': 'API Key',
  'st.provider.field.model': 'Model',
  'st.provider.field.model_optional': 'Model (optional)',
  'st.provider.field.supports_vision': 'Model supports vision (multimodal)',
  'st.provider.field.compact_prompt': 'Compact prompt (recommended for small models, on by default)',
  'st.provider.field.model_loaded_hint': 'leave blank to use loaded model',

  'st.vision.desc': 'If set, screenshots are sent to this model for reading the page, while the active provider handles planning and tool calls. Leave blank to use the active provider for vision too. OpenAI-compatible endpoints only.',
  'st.vision.save': 'Save',
  'st.vision.test': 'Test Connection',
  'st.vision.clear': 'Clear',
  'st.vision.cleared': 'Cleared.',
  'st.vision.saved': 'Saved!',
  'st.vision.testing': 'Testing...',
  'st.vision.connected': 'Connected! Model: {model}',
  'st.vision.failed': 'Failed: {error}',
  'st.vision.fill_required': 'Fill in Base URL and Model first.',

  'st.profile.desc_html': 'Store a short bio the agent can use to fill signup forms without asking every time — your name, work email, company, and a <em>throwaway</em> password for low-stakes signups. When enabled, the text below is appended to the agent\'s system prompt on every conversation.',
  'st.profile.enabled.label': 'Enable profile auto-fill',
  'st.profile.enabled.desc': 'Inject the profile text into the agent\'s system prompt. Disabled = the agent never sees this text.',
  'st.profile.text.label': 'Profile text',
  'st.profile.text.placeholder': 'I\'m Jane Doe. My email is jane@example.com. I work for Acme Inc. My default password for low-stakes signups is SomePhrase-42!. I\'m based in Berlin.',
  'st.profile.save': 'Save',
  'st.profile.clear': 'Clear',
  'st.profile.saved': 'Saved.',
  'st.profile.cleared': 'Cleared.',
  'st.profile.security_html': '<strong>Security — read this:</strong><br><ul style="margin:6px 0 0 18px;padding:0;line-height:1.55;"><li>The text you enter here is stored <strong>in plaintext</strong> in your browser\'s local storage. It is <strong>not</strong> transmitted to the WebBrain project — but it <strong>is</strong> sent to whichever LLM provider you have configured on every turn, as part of the system prompt.</li><li><strong>Do not put passwords for important accounts</strong> here (Google, Apple, iCloud, banking, work SSO, primary email). Those accounts should use 2FA and you shouldn\'t need to hand them to an agent anyway.</li><li>A <strong>throwaway password</strong> you reuse for low-stakes site signups (newsletters, free trials, forum accounts) is the intended use case.</li><li>If this browser profile is ever compromised, an attacker with disk access can read this text. Keep it minimal.</li></ul>',

  'st.captcha.desc_html': 'Let the agent solve CAPTCHAs automatically via the <a href="https://capsolver.com" target="_blank" style="color:var(--accent);">CapSolver</a> API. Supports reCAPTCHA v2/v3, hCaptcha, and Cloudflare Turnstile. Off by default — when off, the agent stops and asks you to solve the captcha yourself. CapSolver charges per solve (~$0.001–$0.003); you bring your own account and API key.',
  'st.captcha.enabled.label': 'Enable CapSolver',
  'st.captcha.enabled.desc': 'When the agent hits a CAPTCHA it will call CapSolver once before falling back to asking you. Requires an API key below.',
  'st.captcha.api_key.label': 'CapSolver API Key',
  'st.captcha.save': 'Save Key',
  'st.captcha.check_balance': 'Check Balance',
  'st.captcha.clear': 'Clear',
  'st.captcha.saved': 'Saved.',
  'st.captcha.cleared': 'Cleared.',
  'st.captcha.checking': 'Checking balance…',
  'st.captcha.need_key': 'Enter an API key first.',
  'st.captcha.balance_ok': 'OK — balance: {balance}',
  'st.captcha.balance_fail': 'Failed: {error}',
  'st.captcha.security_html': '<strong>Heads-up:</strong> the API key is stored <strong>in plaintext</strong> in browser local storage. CapSolver charges your account for every solve; the agent will only call it when a CAPTCHA actually blocks a step (max once per encounter — it won\'t retry on failure). Some sites\' terms of service prohibit automated CAPTCHA solving; use your judgement.',

  // --- Traces page -------------------------------------------------------
  'tr.title': 'WebBrain Traces',
  'tr.runs': '{n} runs',
  'tr.run': '{n} run',
  'tr.btn.refresh': '↻ Refresh',
  'tr.btn.refresh.title': 'Reload run list',
  'tr.btn.compare': '⇔ Compare',
  'tr.btn.compare.title': 'Enter compare mode (pick 2 runs)',
  'tr.btn.compare.picking': '⇔ Compare (pick 2)',
  'tr.btn.export': '⇩ Export JSON',
  'tr.btn.export.title': 'Export selected run as JSON',
  'tr.btn.delete': '✕ Delete',
  'tr.btn.delete.title': 'Delete selected run',
  'tr.btn.clear_all': 'Clear all',
  'tr.btn.clear_all.title': 'Delete every stored run',

  'tr.filter.placeholder': 'Filter by task / model / URL',
  'tr.filter.all_models': 'All models',
  'tr.no_match': 'No runs match.',
  'tr.no_task': '(no task)',

  'tr.conversation.label': 'Conversation',
  'tr.conversation.turn_of': 'turn {n} of {total}',
  'tr.conversation.tooltip': 'Part of a {n}-turn conversation ({id}). Open the run to jump between turns.',

  'tr.cost.label': 'Cost:',
  'tr.cost.tooltip': 'Total LLM cost reported by the provider (USD). Highlighted in orange when ≥ $0.50 with no final answer — likely a wasted run.',

  'tr.empty.title': 'No run selected.',
  'tr.empty.hint_html': 'Pick a run from the left to see its step-by-step timeline. Click <b>Compare</b> to pick two runs and view them side-by-side.',

  'tr.compare_mode.title': 'Compare mode',
  'tr.compare_mode.picked': 'Picked {n}/2. Click another run to complete the comparison.',
  'tr.compare_mode.hint': 'Click two runs in the list to compare them side-by-side.',

  'tr.status.label': 'status',
  'tr.steps.label': 'steps',
  'tr.step': '{n} step',
  'tr.steps_plural': '{n} steps',
  'tr.duration.label': 'duration',
  'tr.intokens.label': 'in-tokens',
  'tr.outtokens.label': 'out-tokens',
  'tr.tokens_short': '{n} tok',
  'tr.unknown_model': 'unknown',
  'tr.final_label': 'Final:',

  'tr.deleted': 'Deleted.',
  'tr.all_deleted': 'All runs deleted.',
  'tr.select_first': 'Select a run first.',
  'tr.confirm_delete': 'Delete this run?',
  'tr.confirm_delete_all': 'Delete ALL recorded runs? This cannot be undone.',

  'tr.event.llm_request': '→ LLM request',
  'tr.event.llm_response': '← LLM response',
  'tr.event.vision_sub_call': '👁 vision sub-call',
  'tr.event.error_kind': '⚠ error',
  'tr.event.messages_tools': '{m} messages, {t} tools · {model}',
  'tr.event.screenshot_caption': 'screenshot',
  'tr.event.screenshot_missing': '(screenshot blob missing)',
  'tr.event.description_truncated': '... [truncated in compare view]',
  'tr.event.vision_failed': 'vision sub-call failed: {error}',
  'tr.event.description': 'description',
  'tr.event.args': 'args',
  'tr.event.result': 'result',
  'tr.event.step': 'step {step}',
};
