export const languages = [
  { code: "en", label: "English", htmlLang: "en" },
  { code: "zh", label: "中文", htmlLang: "zh-CN" },
  { code: "es", label: "Español", htmlLang: "es" },
  { code: "ja", label: "日本語", htmlLang: "ja" },
  { code: "ko", label: "한국어", htmlLang: "ko" },
  { code: "fr", label: "Français", htmlLang: "fr" },
  { code: "pt", label: "Português", htmlLang: "pt-BR" },
  { code: "de", label: "Deutsch", htmlLang: "de" },
] as const;

export type Language = (typeof languages)[number]["code"];

export type Copy = {
  brandKicker: string;
  title: string;
  description: string;
  live: string;
  snapshot: string;
  updated: string;
  justNow: string;
  ago: string;
  dayShort: string;
  hourShort: string;
  minuteShort: string;
  secondShort: string;
  refresh: string;
  language: string;
  forkEyebrow: string;
  forkTitle: string;
  forkDescription: string;
  copy: string;
  copied: string;
  download: string;
  volume24h: string;
  trackedLiquidity: string;
  swaps24h: string;
  ammPools: string;
  acrossAmms: string;
  acrossPools: string;
  buysSells: string;
  assets: string;
  venues: string;
  correlationTitle: string;
  nodeEdgeVolume: string;
  nodeEdgeLiquidity: string;
  volume: string;
  liquidity: string;
  stablecoin: string;
  btcWrapper: string;
  tokenizedEquity: string;
  otherToken: string;
  bridgePair: string;
  correlatedPair: string;
  trackedAmms: string;
  smaller: string;
  everyTicker: string;
  selectedAsset: string;
  featuredHub: string;
  swaps: string;
  connections: string;
  indexedPrice: string;
  strongestRoutes: string;
  pool: string;
  pools: string;
  methodPrefix: string;
  methodSuffix: string;
  dataCredit: string;
  rawPools: string;
  haydensGraph: string;
  connecting: string;
  tryAgain: string;
  refreshError: string;
};

export const copy: Record<Language, Copy> = {
  en: {
    brandKicker: "Robinhood · Ethereum · Base · live AMMs", title: "AMM Correlated-pairs liquidity network",
    description: "Live AMM liquidity, trading routes, and correlated pairs on Robinhood · Ethereum · Base.",
    live: "LIVE", snapshot: "SNAPSHOT", updated: "Updated", justNow: "now", ago: "ago",
    dayShort: "d", hourShort: "h", minuteShort: "m", secondShort: "s", refresh: "Refresh live liquidity", language: "Language",
    forkEyebrow: "OPEN SOURCE", forkTitle: "Fork the network", forkDescription: "Clone the complete dashboard and build your own market map.",
    copy: "Copy", copied: "Copied", download: "Download source",
    volume24h: "24h volume", trackedLiquidity: "Tracked liquidity", swaps24h: "24h swaps", ammPools: "AMM pools",
    acrossAmms: "Across tracked AMMs", acrossPools: "Across indexed pools", buysSells: "Buys + sells", assets: "assets", venues: "venues",
    correlationTitle: "Correlation becomes liquidity", nodeEdgeVolume: "Node size = aggregate volume. Edge thickness = pair volume.",
    nodeEdgeLiquidity: "Node size = aggregate liquidity. Edge thickness = pair liquidity.", volume: "24h volume", liquidity: "Liquidity",
    stablecoin: "Stablecoin", btcWrapper: "BTC wrapper", tokenizedEquity: "Tokenized equity", otherToken: "Other token",
    bridgePair: "bridge pair", correlatedPair: "correlated pair", trackedAmms: "Tracked AMMs", smaller: "smaller",
    everyTicker: "Every ticker is labeled · tap one to trace its routes", selectedAsset: "Selected asset", featuredHub: "Featured network hub",
    swaps: "24h swaps", connections: "Connections", indexedPrice: "Indexed price", strongestRoutes: "Strongest routes",
    pool: "pool", pools: "pools", methodPrefix: "Top", methodSuffix: "AMM pools scanned; venues are combined by token pair.",
    dataCredit: "Data: GeckoTerminal community index · refreshes continuously", rawPools: "Raw pools", haydensGraph: "Hayden’s Post on AMM Correlated Pairs",
    connecting: "Connecting to Robinhood · Ethereum · Base liquidity…", tryAgain: "Try again", refreshError: "Liquidity data could not be refreshed.",
  },
  zh: {
    brandKicker: "Robinhood · Ethereum · Base · 实时 AMM", title: "AMM 相关交易对流动性网络",
    description: "Robinhood · Ethereum · Base 上的实时 AMM 流动性、交易路径与相关交易对。",
    live: "实时", snapshot: "快照", updated: "更新于", justNow: "刚刚", ago: "前",
    dayShort: "天", hourShort: "小时", minuteShort: "分", secondShort: "秒", refresh: "刷新实时流动性", language: "语言",
    forkEyebrow: "开源", forkTitle: "复刻这个网络", forkDescription: "克隆完整仪表盘，构建你自己的市场地图。",
    copy: "复制", copied: "已复制", download: "下载源码",
    volume24h: "24 小时交易量", trackedLiquidity: "追踪流动性", swaps24h: "24 小时交易", ammPools: "AMM 池",
    acrossAmms: "覆盖已追踪 AMM", acrossPools: "覆盖已索引池", buysSells: "买入 + 卖出", assets: "种资产", venues: "个场所",
    correlationTitle: "相关性转化为流动性", nodeEdgeVolume: "节点大小 = 总交易量；边宽 = 交易对交易量。",
    nodeEdgeLiquidity: "节点大小 = 总流动性；边宽 = 交易对流动性。", volume: "24 小时交易量", liquidity: "流动性",
    stablecoin: "稳定币", btcWrapper: "BTC 封装资产", tokenizedEquity: "代币化股票", otherToken: "其他代币",
    bridgePair: "桥接交易对", correlatedPair: "相关交易对", trackedAmms: "已追踪 AMM", smaller: "个较小场所",
    everyTicker: "每个节点均标注代码 · 点击查看流动性路径", selectedAsset: "所选资产", featuredHub: "核心网络枢纽",
    swaps: "24 小时交易", connections: "连接数", indexedPrice: "索引价格", strongestRoutes: "最强路径",
    pool: "个池", pools: "个池", methodPrefix: "扫描排名前", methodSuffix: "个 AMM 池；按交易对合并各场所。",
    dataCredit: "数据：GeckoTerminal 社区索引 · 持续刷新", rawPools: "原始池", haydensGraph: "Hayden 关于 AMM 相关交易对的文章",
    connecting: "正在连接 Robinhood · Ethereum · Base 流动性…", tryAgain: "重试", refreshError: "无法刷新流动性数据。",
  },
  es: {
    brandKicker: "Robinhood · Ethereum · Base · AMM en vivo", title: "AMM Red de liquidez de pares correlacionados",
    description: "Liquidez AMM, rutas y pares correlacionados en Robinhood · Ethereum · Base, en tiempo real.",
    live: "EN VIVO", snapshot: "INSTANTÁNEA", updated: "Actualizado", justNow: "ahora", ago: "atrás",
    dayShort: "d", hourShort: "h", minuteShort: "min", secondShort: "s", refresh: "Actualizar liquidez", language: "Idioma",
    forkEyebrow: "CÓDIGO ABIERTO", forkTitle: "Bifurca la red", forkDescription: "Clona el panel completo y crea tu propio mapa de mercado.",
    copy: "Copiar", copied: "Copiado", download: "Descargar código",
    volume24h: "Volumen 24h", trackedLiquidity: "Liquidez rastreada", swaps24h: "Swaps 24h", ammPools: "Pools AMM",
    acrossAmms: "En todos los AMM", acrossPools: "En pools indexados", buysSells: "Compras + ventas", assets: "activos", venues: "plataformas",
    correlationTitle: "La correlación se vuelve liquidez", nodeEdgeVolume: "Nodo = volumen agregado. Línea = volumen del par.",
    nodeEdgeLiquidity: "Nodo = liquidez agregada. Línea = liquidez del par.", volume: "Volumen 24h", liquidity: "Liquidez",
    stablecoin: "Stablecoin", btcWrapper: "BTC envuelto", tokenizedEquity: "Acción tokenizada", otherToken: "Otro token",
    bridgePair: "par puente", correlatedPair: "par correlacionado", trackedAmms: "AMM rastreados", smaller: "menores",
    everyTicker: "Todos los tickers visibles · toca uno para seguir sus rutas", selectedAsset: "Activo seleccionado", featuredHub: "Nodo destacado",
    swaps: "Swaps 24h", connections: "Conexiones", indexedPrice: "Precio indexado", strongestRoutes: "Rutas principales",
    pool: "pool", pools: "pools", methodPrefix: "Se analizaron los", methodSuffix: "principales pools AMM; las plataformas se combinan por par.",
    dataCredit: "Datos: índice comunitario GeckoTerminal · actualización continua", rawPools: "Pools originales", haydensGraph: "Publicación de Hayden sobre pares correlacionados en AMM",
    connecting: "Conectando con la liquidez de Robinhood · Ethereum · Base…", tryAgain: "Reintentar", refreshError: "No se pudo actualizar la liquidez.",
  },
  ja: {
    brandKicker: "Robinhood · Ethereum · Base · ライブ AMM", title: "AMM 相関ペア流動性ネットワーク",
    description: "Robinhood · Ethereum · Base の AMM 流動性、取引経路、相関ペアをリアルタイム表示。",
    live: "ライブ", snapshot: "スナップショット", updated: "更新", justNow: "たった今", ago: "前",
    dayShort: "日", hourShort: "時間", minuteShort: "分", secondShort: "秒", refresh: "流動性を更新", language: "言語",
    forkEyebrow: "オープンソース", forkTitle: "ネットワークをフォーク", forkDescription: "ダッシュボード全体をクローンし、独自の市場マップを構築できます。",
    copy: "コピー", copied: "コピー済み", download: "ソースをダウンロード",
    volume24h: "24時間出来高", trackedLiquidity: "追跡流動性", swaps24h: "24時間スワップ", ammPools: "AMM プール",
    acrossAmms: "追跡 AMM 全体", acrossPools: "インデックス済みプール", buysSells: "買い + 売り", assets: "資産", venues: "取引所",
    correlationTitle: "相関が流動性になる", nodeEdgeVolume: "ノード = 合計出来高。線幅 = ペア出来高。",
    nodeEdgeLiquidity: "ノード = 合計流動性。線幅 = ペア流動性。", volume: "24時間出来高", liquidity: "流動性",
    stablecoin: "ステーブルコイン", btcWrapper: "BTC ラッパー", tokenizedEquity: "トークン化株式", otherToken: "その他",
    bridgePair: "ブリッジペア", correlatedPair: "相関ペア", trackedAmms: "追跡 AMM", smaller: "件の小規模",
    everyTicker: "全ティッカーを表示 · タップして経路を追跡", selectedAsset: "選択中の資産", featuredHub: "注目ハブ",
    swaps: "24時間スワップ", connections: "接続数", indexedPrice: "参照価格", strongestRoutes: "主要ルート",
    pool: "プール", pools: "プール", methodPrefix: "上位", methodSuffix: "AMM プールを走査し、取引所をペア単位で統合。",
    dataCredit: "データ：GeckoTerminal コミュニティ指数 · 継続更新", rawPools: "元データ", haydensGraph: "Hayden の AMM 相関ペアに関する投稿",
    connecting: "Robinhood · Ethereum · Base の流動性に接続中…", tryAgain: "再試行", refreshError: "流動性データを更新できませんでした。",
  },
  ko: {
    brandKicker: "Robinhood · Ethereum · Base · 실시간 AMM", title: "AMM 상관 페어 유동성 네트워크",
    description: "Robinhood · Ethereum · Base의 AMM 유동성, 거래 경로, 상관 페어를 실시간으로 확인하세요.",
    live: "실시간", snapshot: "스냅샷", updated: "업데이트", justNow: "방금", ago: "전",
    dayShort: "일", hourShort: "시간", minuteShort: "분", secondShort: "초", refresh: "유동성 새로고침", language: "언어",
    forkEyebrow: "오픈 소스", forkTitle: "네트워크 포크", forkDescription: "전체 대시보드를 복제하고 나만의 시장 지도를 만드세요.",
    copy: "복사", copied: "복사됨", download: "소스 다운로드",
    volume24h: "24시간 거래량", trackedLiquidity: "추적 유동성", swaps24h: "24시간 스왑", ammPools: "AMM 풀",
    acrossAmms: "추적 AMM 전체", acrossPools: "인덱싱된 풀", buysSells: "매수 + 매도", assets: "자산", venues: "거래소",
    correlationTitle: "상관성이 유동성이 된다", nodeEdgeVolume: "노드 = 총 거래량. 선 두께 = 페어 거래량.",
    nodeEdgeLiquidity: "노드 = 총 유동성. 선 두께 = 페어 유동성.", volume: "24시간 거래량", liquidity: "유동성",
    stablecoin: "스테이블코인", btcWrapper: "BTC 래퍼", tokenizedEquity: "토큰화 주식", otherToken: "기타 토큰",
    bridgePair: "브리지 페어", correlatedPair: "상관 페어", trackedAmms: "추적 AMM", smaller: "개 소규모",
    everyTicker: "모든 티커 표시 · 탭하여 경로 추적", selectedAsset: "선택 자산", featuredHub: "주요 네트워크 허브",
    swaps: "24시간 스왑", connections: "연결", indexedPrice: "인덱스 가격", strongestRoutes: "주요 경로",
    pool: "풀", pools: "풀", methodPrefix: "상위", methodSuffix: "AMM 풀을 스캔하고 거래소를 페어별로 합산합니다.",
    dataCredit: "데이터: GeckoTerminal 커뮤니티 인덱스 · 지속 업데이트", rawPools: "원본 풀", haydensGraph: "Hayden의 AMM 상관 페어 게시물",
    connecting: "Robinhood · Ethereum · Base 유동성 연결 중…", tryAgain: "다시 시도", refreshError: "유동성 데이터를 새로고침할 수 없습니다.",
  },
  fr: {
    brandKicker: "Robinhood · Ethereum · Base · AMM en direct", title: "AMM Réseau de liquidité des paires corrélées",
    description: "Liquidité AMM, routes de trading et paires corrélées sur Robinhood · Ethereum · Base, en direct.",
    live: "DIRECT", snapshot: "INSTANTANÉ", updated: "Actualisé", justNow: "maintenant", ago: "plus tôt",
    dayShort: "j", hourShort: "h", minuteShort: "min", secondShort: "s", refresh: "Actualiser la liquidité", language: "Langue",
    forkEyebrow: "OPEN SOURCE", forkTitle: "Forker le réseau", forkDescription: "Clonez le tableau complet et créez votre propre carte de marché.",
    copy: "Copier", copied: "Copié", download: "Télécharger le code",
    volume24h: "Volume 24h", trackedLiquidity: "Liquidité suivie", swaps24h: "Swaps 24h", ammPools: "Pools AMM",
    acrossAmms: "Tous les AMM suivis", acrossPools: "Pools indexés", buysSells: "Achats + ventes", assets: "actifs", venues: "plateformes",
    correlationTitle: "La corrélation devient liquidité", nodeEdgeVolume: "Nœud = volume agrégé. Ligne = volume de la paire.",
    nodeEdgeLiquidity: "Nœud = liquidité agrégée. Ligne = liquidité de la paire.", volume: "Volume 24h", liquidity: "Liquidité",
    stablecoin: "Stablecoin", btcWrapper: "BTC enveloppé", tokenizedEquity: "Action tokenisée", otherToken: "Autre token",
    bridgePair: "paire passerelle", correlatedPair: "paire corrélée", trackedAmms: "AMM suivis", smaller: "plus petits",
    everyTicker: "Chaque ticker est visible · touchez-en un pour suivre ses routes", selectedAsset: "Actif sélectionné", featuredHub: "Hub principal",
    swaps: "Swaps 24h", connections: "Connexions", indexedPrice: "Prix indexé", strongestRoutes: "Meilleures routes",
    pool: "pool", pools: "pools", methodPrefix: "Les", methodSuffix: "principaux pools AMM sont analysés et agrégés par paire.",
    dataCredit: "Données : index communautaire GeckoTerminal · actualisation continue", rawPools: "Pools bruts", haydensGraph: "Publication de Hayden sur les paires corrélées AMM",
    connecting: "Connexion à la liquidité Robinhood · Ethereum · Base…", tryAgain: "Réessayer", refreshError: "Impossible d’actualiser les données.",
  },
  pt: {
    brandKicker: "Robinhood · Ethereum · Base · AMMs ao vivo", title: "AMM Rede de liquidez de pares correlacionados",
    description: "Liquidez AMM, rotas e pares correlacionados na Robinhood · Ethereum · Base, em tempo real.",
    live: "AO VIVO", snapshot: "INSTANTÂNEO", updated: "Atualizado", justNow: "agora", ago: "atrás",
    dayShort: "d", hourShort: "h", minuteShort: "min", secondShort: "s", refresh: "Atualizar liquidez", language: "Idioma",
    forkEyebrow: "CÓDIGO ABERTO", forkTitle: "Faça um fork da rede", forkDescription: "Clone o painel completo e crie seu próprio mapa de mercado.",
    copy: "Copiar", copied: "Copiado", download: "Baixar código",
    volume24h: "Volume 24h", trackedLiquidity: "Liquidez rastreada", swaps24h: "Swaps 24h", ammPools: "Pools AMM",
    acrossAmms: "Em todos os AMMs", acrossPools: "Em pools indexados", buysSells: "Compras + vendas", assets: "ativos", venues: "plataformas",
    correlationTitle: "Correlação vira liquidez", nodeEdgeVolume: "Nó = volume agregado. Linha = volume do par.",
    nodeEdgeLiquidity: "Nó = liquidez agregada. Linha = liquidez do par.", volume: "Volume 24h", liquidity: "Liquidez",
    stablecoin: "Stablecoin", btcWrapper: "BTC encapsulado", tokenizedEquity: "Ação tokenizada", otherToken: "Outro token",
    bridgePair: "par ponte", correlatedPair: "par correlacionado", trackedAmms: "AMMs rastreados", smaller: "menores",
    everyTicker: "Todos os tickers visíveis · toque para seguir as rotas", selectedAsset: "Ativo selecionado", featuredHub: "Hub em destaque",
    swaps: "Swaps 24h", connections: "Conexões", indexedPrice: "Preço indexado", strongestRoutes: "Rotas mais fortes",
    pool: "pool", pools: "pools", methodPrefix: "Os", methodSuffix: "principais pools AMM são escaneados e combinados por par.",
    dataCredit: "Dados: índice comunitário GeckoTerminal · atualização contínua", rawPools: "Pools brutos", haydensGraph: "Publicação de Hayden sobre pares correlacionados AMM",
    connecting: "Conectando à liquidez da Robinhood · Ethereum · Base…", tryAgain: "Tentar novamente", refreshError: "Não foi possível atualizar os dados.",
  },
  de: {
    brandKicker: "Robinhood · Ethereum · Base · Live-AMMs", title: "AMM Liquiditätsnetz korrelierter Paare",
    description: "Live-AMM-Liquidität, Handelsrouten und korrelierte Paare auf Robinhood · Ethereum · Base.",
    live: "LIVE", snapshot: "SNAPSHOT", updated: "Aktualisiert", justNow: "jetzt", ago: "zuvor",
    dayShort: "T", hourShort: "Std", minuteShort: "Min", secondShort: "Sek", refresh: "Liquidität aktualisieren", language: "Sprache",
    forkEyebrow: "OPEN SOURCE", forkTitle: "Netzwerk forken", forkDescription: "Klone das vollständige Dashboard und baue deine eigene Marktkarte.",
    copy: "Kopieren", copied: "Kopiert", download: "Quellcode laden",
    volume24h: "24h-Volumen", trackedLiquidity: "Erfasste Liquidität", swaps24h: "24h-Swaps", ammPools: "AMM-Pools",
    acrossAmms: "Über alle AMMs", acrossPools: "Über indexierte Pools", buysSells: "Käufe + Verkäufe", assets: "Assets", venues: "Handelsplätze",
    correlationTitle: "Korrelation wird Liquidität", nodeEdgeVolume: "Knoten = Gesamtvolumen. Kante = Paarvolumen.",
    nodeEdgeLiquidity: "Knoten = Gesamtliquidität. Kante = Paarliquidität.", volume: "24h-Volumen", liquidity: "Liquidität",
    stablecoin: "Stablecoin", btcWrapper: "BTC-Wrapper", tokenizedEquity: "Tokenisierte Aktie", otherToken: "Anderer Token",
    bridgePair: "Brückenpaar", correlatedPair: "korreliertes Paar", trackedAmms: "Erfasste AMMs", smaller: "kleinere",
    everyTicker: "Jeder Ticker ist sichtbar · antippen, um Routen zu verfolgen", selectedAsset: "Ausgewähltes Asset", featuredHub: "Zentraler Hub",
    swaps: "24h-Swaps", connections: "Verbindungen", indexedPrice: "Indexpreis", strongestRoutes: "Stärkste Routen",
    pool: "Pool", pools: "Pools", methodPrefix: "Die Top", methodSuffix: "AMM-Pools werden gescannt und pro Paar zusammengeführt.",
    dataCredit: "Daten: GeckoTerminal Community-Index · laufende Aktualisierung", rawPools: "Rohdaten", haydensGraph: "Haydens Beitrag zu korrelierten AMM-Paaren",
    connecting: "Verbindung zur AMM-Liquidität…", tryAgain: "Erneut versuchen", refreshError: "Liquiditätsdaten konnten nicht aktualisiert werden.",
  },
};

export function isLanguage(value: string): value is Language {
  return languages.some((language) => language.code === value);
}

export function languagePath(language: Language) {
  return language === "en" ? "/" : `/${language}`;
}
