import Foundation
import Observation

/// In-memory localization registry.
///
/// SwiftUI does not support runtime language switching out of the box — the
/// system bundle picks a language at launch based on `Locale.preferredLanguages`
/// and won't re-load `.strings` files when the locale environment changes. To
/// get instant switching we keep zh/en string tables in memory and re-render
/// any view that reads from this `@Observable` singleton.
///
/// Usage from views:
/// ```
/// Text(L("settings.title"))                       // simple lookup
/// Text(L("export.willExport", matched, allItems)) // printf-style format
/// ```
///
/// When `appLanguage` is `.system`, the manager resolves to either `.zh` or
/// `.en` based on `Locale.preferredLanguages`.
@Observable
final class L10n {
    static let shared = L10n()

    /// Active user preference. `system` defers to OS locale.
    var language: AppLanguage = .system

    private var observer: NSObjectProtocol?

    private init() {
        refreshFromDefaults()
        observer = NotificationCenter.default.addObserver(
            forName: UserDefaults.didChangeNotification,
            object: UserDefaults.standard,
            queue: .main
        ) { [weak self] _ in
            self?.refreshFromDefaults()
        }
    }

    deinit {
        if let observer { NotificationCenter.default.removeObserver(observer) }
    }

    private func refreshFromDefaults() {
        let raw = UserDefaults.standard.string(forKey: "appLanguage")
            ?? AppLanguage.system.rawValue
        let next = AppLanguage(rawValue: raw) ?? .system
        if next != language { language = next }
    }

    /// Resolves `.system` into a concrete language by looking at the OS locale.
    var effectiveLanguage: AppLanguage {
        if language == .system {
            let preferred = Locale.preferredLanguages.first ?? "en"
            return preferred.hasPrefix("zh") ? .zh : .en
        }
        return language
    }

    /// Look up the translation for `key` in the active language. Falls back to
    /// the Chinese table (the original strings), then to the key itself.
    func t(_ key: String) -> String {
        let table = (effectiveLanguage == .zh) ? Self.zh : Self.en
        if let value = table[key] { return value }
        return Self.zh[key] ?? key
    }
}

/// Translate `key`. Use inside SwiftUI view bodies — accessing
/// `L10n.shared.language` registers the view as a dependency, so the view
/// re-renders automatically when the user picks a different language.
func L(_ key: String) -> String { L10n.shared.t(key) }

/// `printf`-style formatted translation. Use when you need to interpolate
/// numbers or strings without breaking word order across languages.
func L(_ key: String, _ args: any CVarArg...) -> String {
    String(format: L10n.shared.t(key), arguments: args)
}

// MARK: - Tables

extension L10n {
    static let zh: [String: String] = [
        // common
        "common.copy": "复制",
        "common.copied": "已复制",
        "common.copiedPlainText": "已复制为纯文本",
        "dynamicIsland.copied": "已复制到剪贴板",
        "dynamicIsland.openHint": "点击展开",
        "common.confirmDestructive": "确定？再次点击执行",
        "common.confirmTooltip": "再次点击确认执行（此操作不可撤销）",
        "common.clear": "清除",
        // confirm dialogs
        "confirm.deleteItem.title": "删除此条目？",
        "confirm.deleteItem.message": "条目会移到垃圾桶，可在垃圾桶中恢复。",
        "confirm.deleteSelected.titleFormat": "删除选中的 %d 条？",
        "confirm.permanent.message": "此操作无法撤销。",
        "confirm.purge.title": "彻底删除此条目？",
        "confirm.empty.title": "清空垃圾桶？",
        "confirm.empty.messageFormat": "将永久删除全部 %d 个条目，此操作无法撤销。",
        "confirm.clearRange.titleFormat": "清除「%@」的记录？",
        "confirm.clearRange.softMessage": "符合条件的条目会移到垃圾桶。",
        "confirm.deleteAll.title": "删除所有数据？",
        "confirm.deleteAll.message": "将永久删除全部剪贴板历史，此操作无法撤销。",
        "confirm.clearStats.title": "清除统计数据？",
        "confirm.deleteGroup.title": "删除此分组？",
        "confirm.deleteGroup.message": "分组会被移除，条目会保留并移出该分组，不会删除剪贴板内容。",
        "quit.confirm.title": "退出剪迹？",
        "quit.confirm.message": "退出后将停止监听剪贴板，直到你再次打开应用。",
        "quit.confirm.button": "退出",
        "store.reset.notice": "剪贴板历史无法打开，已重置为新库；旧数据已备份到应用支持目录的 StoreBackups 中。",
        "common.delete": "删除",
        "common.deleted": "已删除",
        "common.cancel": "取消",
        "common.done": "完成",
        "common.save": "保存",
        "common.close": "关闭",
        "common.back": "返回",
        "common.unknown": "未知",
        "common.unknownSource": "未知来源",
        "common.notSet": "尚未添加",
        "common.all": "全部",
        "common.today": "今天",
        "common.yesterday": "昨天",
        "common.preview": "预览",
        "common.add": "添加",
        "common.remove": "移除",
        "common.reset": "重置",
        "common.allTypes": "全部类型",
        "common.allApps": "全部应用",
        "common.search": "搜索…",
        "common.searchContent": "搜索内容…",
        "common.semanticSearch": "语义搜索…",
        "common.tagSearch": "输入以筛选标签…",
        "common.searchMode.tag": "标签",
        "common.searchHint.tooltip": "切换到「标签」模式后输入可筛选标签，点击或回车将其加为筛选条件。「任一 / 全部」匹配方式可在 设置 → 过滤 中调整。\n搜索栏支持过滤词：app:Safari、since:2d、before:2026-05-01。",
        "common.searchMode.full": "全文",
        "common.searchMode.semantic": "语义",
        "common.searchMode.indexing": "建索引中…",
        "common.clearSearch": "清空搜索",
        "filter.title": "筛选",
        "filter.type": "类型",
        "filter.app": "应用",
        "filter.noApps": "暂无应用来源",
        "search.semantic.indexing.toast": "语义索引仍在生成，请稍后再试",
        "search.semantic.disabled.toast": "语义搜索已在设置中关闭",
        "search.tagPicker.empty": "没有匹配的标签",
        "search.tagPicker.none": "还没有标签 · 先在列表项上添加标签",
        "search.tagMode.any": "任一",
        "search.tagMode.all": "全部",
        "search.tagMode.tooltip.any": "命中任一标签即显示（并集）",
        "search.tagMode.tooltip.all": "必须同时包含所有标签（交集）",

        // types
        "type.text": "文本",
        "type.image": "图片",
        "type.video": "视频",
        "type.file": "文件",
        "type.url": "链接",
        "type.rtf": "富文本",

        // descriptive tags for files
        "tag.application": "应用程序",
        "tag.installer": "安装包",
        "tag.dmg": "磁盘映像",
        "tag.ipa": "应用包",
        "tag.folder": "文件夹",
        "tag.audio": "音频文件",
        "tag.video": "视频文件",
        "tag.image": "图片文件",
        "tag.pdf": "PDF 文档",
        "tag.archive": "压缩文件",
        "tag.sourceCode": "代码文件",
        "tag.spreadsheet": "电子表格",
        "tag.presentation": "演示文稿",
        "tag.html": "网页文件",
        "tag.json": "JSON 文件",
        "tag.xml": "XML 文件",
        "tag.rtfFile": "富文本文件",
        "tag.plainText": "文本文件",
        "tag.bundle": "软件包",

        // remote / source app
        "remote.universalClipboard": "通用剪贴板",
        "snippet.sourceApp": "片段",

        // list scope
        "scope.all": "全部",
        "scope.favorites": "收藏",
        "favorites.sort.help": "收藏列表排序方式",
        "favorites.sort.dateNewest": "最新优先",
        "favorites.sort.dateOldest": "最早优先",
        "favorites.sort.name": "按名称",
        "favorites.sort.type": "按类型",

        // groups
        "group.all": "全部数据",
        "group.ungrouped": "无分组归属",
        "group.untitled": "未命名分组",
        "group.missing": "分组已移除",
        "group.moveTo": "加入分组",
        "group.removeFromGroup": "移出全部分组",
        "group.removedFromGroup": "已移出分组",
        "group.addedToFormat": "已加入「%@」",
        "group.removedFromFormat": "已移出「%@」",
        "group.newAndMove": "新建分组并移动…",
        "group.create": "新建分组…",
        "group.create.title": "新建分组",
        "group.manage": "管理分组…",
        "group.manage.title": "管理分组",
        "group.manage.subtitle": "在这里新增、重命名或删除分组。删除分组不会删除剪贴板内容。",
        "group.manage.empty": "还没有分组",
        "group.manage.empty.subtitle": "先输入名称创建一个分组。",
        "group.delete": "删除分组",
        "group.rename.title": "重命名分组",
        "group.filter.title": "分组筛选",
        "group.editor.subtitle": "分组会按你在设置中的顺序显示。",
        "group.name.placeholder": "分组名称",
        "group.createdFormat": "已创建分组「%@」",
        "group.movedToFormat": "已移动到「%@」",
        "group.deletedFormat": "已删除分组「%@」",
        "group.renamed": "分组已重命名",
        "group.filter.help": "按数据分组筛选",
        "group.moveUp": "上移分组",
        "group.moveDown": "下移分组",
        "group.emptyForMove": "还没有可用分组",

        // main window
        "main.title": "剪迹",
        "main.stat.records": "条记录",
        "main.stat.favorites": "收藏",
        "main.stat.today": "今日",
        "main.empty.title.all": "暂无剪贴板记录",
        "main.empty.title.favorites": "还没有收藏的内容",
        "main.empty.title.noMatch": "未找到匹配的内容",
        "main.empty.subtitle.all": "复制点什么试试 — 文本、图片、文件都可以",
        "main.empty.subtitle.favorites": "在条目上点 ☆ 即可加入收藏",
        "main.empty.subtitle.noMatch": "试试其他关键字或类型",
        "main.pinnedCountFormat": "置顶 %d 条",

        // toolbar
        "toolbar.newSnippet": "新建片段",
        "toolbar.multiSelect": "多选",
        "toolbar.exitSelection": "退出选择",
        "toolbar.filters": "筛选",
        "toolbar.filters.help": "按类型或应用筛选",
        "toolbar.trash": "垃圾桶",
        "toolbar.stats": "活跃统计",
        "toolbar.settings": "设置",

        // monitoring pause toggle
        "monitor.active": "监听中",
        "monitor.paused": "已暂停",
        "monitor.pause.tooltip": "暂停剪贴板监听 · 不再记录新内容",
        "monitor.resume.tooltip": "恢复剪贴板监听",

        // bulk trash shortcuts
        "trash.clearLast.sectionTitle": "快速清除",
        "trash.clearLast.sectionHintSoft": "把最近的条目软删进垃圾桶,置顶 / 收藏不动",
        "trash.clearLast.sectionHintHard": "彻底删除最近的条目,置顶 / 收藏不动",
        "trash.clearLast.fiveMin": "最近 5 分钟",
        "trash.clearLast.fifteenMin": "最近 15 分钟",
        "trash.clearLast.oneHour": "最近 1 小时",
        "trash.clearLast.today": "今天全部",
        "trash.clearLast.custom": "自定义",
        "trash.customRange.title": "自定义清除时间段",
        "trash.customRange.start": "开始时间",
        "trash.customRange.end": "结束时间",
        "datetime.year": "年",
        "datetime.month": "月",
        "datetime.day": "日",
        "datetime.hour": "时",
        "datetime.minute": "分",
        "datetime.second": "秒",
        "trash.clearLast.empty": "近期没有可清除的记录",
        "trash.clearLast.doneFormat": "已移除 %d 条",

        // rename
        "rename.title": "重命名条目",
        "rename.subtitle": "为这条剪贴板内容设置自定义标题；留空可恢复默认。",

        // selection / merge
        "selection.selectedFormat": "已选 %d/%d",
        "selection.selectAll": "全选",
        "selection.clear": "清空",
        "selection.invert": "反选",
        "selection.mergeCountFormat": "合并 %d 条",
        "selection.deleteCountFormat": "删除 %d 条",
        "selection.deletedFormat": "已删除 %d 条",
        "selection.moveToGroup": "移动分组",
        "selection.movedToGroupFormat": "已将 %d 条移动到「%@」",
        "selection.removedFromGroupFormat": "已将 %d 条移出分组",
        "selection.merging": "合并中…",
        "selection.mergedFormat": "已合并 %d 条",
        "selection.mergedSuffix.deleted": "（已删除原条目）",
        "selection.requireTwo": "至少选择两条",
        "selection.requireSameType": "选择的类型不一致，无法合并",
        "selection.imageMergeDisabled": "图片合并未启用（设置 → 合并）",
        "selection.mergeFailed": "合并失败",
        "merge.sourceLabelFormat": "合并 (%d 条)",
        "merge.previewTextFormat": "[合并 %d 条] ",
        "merge.previewFileFormat": "[合并 %d 项] ",
        "merge.imageContentFormat": "[图片 拼接 %d 张 · %dKB]",
        "merge.imagePlaceholderFormat": "[图片 %dKB]",
        "merge.rtfPlaceholder": "[富文本]",

        // merge separator presets
        "merge.sep.doubleNewline": "空行",
        "merge.sep.newline": "换行",
        "merge.sep.space": "空格",
        "merge.sep.comma": "逗号",
        "merge.sep.semicolon": "分号",
        "merge.sep.tab": "制表符",
        "merge.sep.custom": "自定义",
        "merge.dir.vertical": "纵向拼接",
        "merge.dir.horizontal": "横向拼接",
        "merge.bg.transparent": "透明",
        "merge.bg.white": "白色",
        "merge.bg.black": "黑色",

        // action bar
        "action.copy": "复制",
        "action.copyAsPlainText": "粘贴为纯文本",
        "action.rename": "重命名…",
        "action.preview": "预览",
        "action.pin": "置顶",
        "action.unpin": "取消置顶",
        "action.favorite": "收藏",
        "action.unfavorite": "取消收藏",
        "action.openInBrowser": "在浏览器中打开",
        "action.saveImage": "保存图片…",
        "action.ocr": "识别文字",
        "action.qrPreview": "二维码预览",
        "action.scanCodes": "解析二维码/条形码",
        "action.encoding": "编码转换",
        "action.base64Encode": "Base64 编码",
        "action.base64Decode": "Base64 解码",
        "action.base64Encoded": "已复制 Base64 编码结果",
        "action.base64Decoded": "已复制 Base64 解码结果",
        "action.base64DecodeFailed": "内容不是有效的 Base64 文本",
        "action.runRule": "运行规则:%@",
        "ocr.title": "图片文字识别",
        "ocr.recognizing": "正在识别…",
        "ocr.empty": "未识别到文字内容",
        "ocr.copyAll": "复制全部",
        "ocr.noImage": "无法加载图片",
        "ocr.rotateLeft": "向左旋转",
        "ocr.rotateRight": "向右旋转",
        "ocr.resetView": "重置视图",
        "ocr.text.title": "识别文本",
        "ocr.text.copy": "复制当前文本",
        "ocr.tab.plain": "纯文本",
        "ocr.tab.structured": "结构化",
        "barcode.title": "二维码/条形码解析",
        "barcode.scanning": "正在解析…",
        "barcode.empty": "未识别到二维码或条形码",
        "barcode.noImage": "无法加载图片",
        "barcode.results": "识别结果",
        "barcode.copyAll": "复制全部结果",
        "barcode.copyValue": "复制内容",
        "barcode.confidenceFormat": "置信度 %.0f%%",
        "qr.title": "文本二维码预览",
        "qr.generating": "正在生成二维码…",
        "qr.unableToGenerate": "无法为此文本生成二维码",
        "qr.scanHint": "用手机或扫码工具扫描即可读取文本",
        "qr.sourceText": "原始文本",
        "qr.byteCountFormat": "%d 字节",
        "qr.copyText": "复制文本",
        "qr.copyImage": "复制二维码图片",
        "qr.copiedImage": "已复制二维码图片",
        "action.editTags": "编辑标签",
        "tags.title": "标签",
        "tags.placeholder": "添加标签…",
        "tags.empty": "暂无标签",
        "action.revealInFinder": "在 Finder 中显示",
        "action.openFile": "打开文件",
        "action.openWith": "用其他应用打开…",
        "action.exportOne": "导出…",
        "action.delete": "删除",
        "action.pinned": "已置顶",
        "action.unpinned": "已取消置顶",
        "action.favorited": "已添加到收藏",
        "action.unfavorited": "已取消收藏",

        // settings
        "settings.title": "设置",
        "settings.tab.general": "通用",
        "settings.tab.shortcut": "快捷键",
        "settings.tab.filter": "过滤",
        "settings.tab.rules": "脚本",
        "settings.tab.privacy": "隐私",
        // Content Protection
        "settings.privacy.title": "内容保护",
        "settings.privacy.master": "启用内容保护",
        "settings.privacy.master.subtitle": "在列表、预览、菜单栏、Dynamic Island、Quick Paste、导出和 MCP 中,对手机号、密钥等敏感内容做脱敏展示。原始内容仍保存在本机,复制/粘贴等复用动作不受影响。",
        "settings.privacy.rules.title": "识别规则",
        "settings.privacy.rules.subtitle": "内置的手机号与 App Key 规则可编辑、可停用;也可以添加关键词或正则自定义规则。命中的内容会被脱敏展示,原始内容不受影响。",
        "settings.privacy.rule.builtin.phone": "手机号",
        "settings.privacy.rule.builtin.key": "App Key / 密钥",
        "settings.privacy.rules.reset": "恢复默认规则",
        "settings.privacy.customRules.add": "添加规则",
        "settings.privacy.customRules.mode.contains": "包含关键词",
        "settings.privacy.customRules.mode.regex": "正则表达式",
        "settings.privacy.customRules.placeholder.contains": "输入要脱敏的关键词",
        "settings.privacy.customRules.placeholder.regex": "输入正则表达式",
        "settings.privacy.customRules.invalidRegex": "正则表达式无效,此规则暂不生效",
        "settings.privacy.egress.title": "原文外发",
        "settings.privacy.rawExport": "导出包含原始敏感内容",
        "settings.privacy.rawExport.subtitle": "关闭时,受保护条目导出为脱敏内容并标记 protected。仅在你明确需要原文时开启。",
        "settings.privacy.rawMCP": "MCP 返回原始敏感内容",
        "settings.privacy.rawMCP.subtitle": "关闭时,MCP 工具默认返回脱敏内容和 protected 标记。仅在你明确需要原文时开启。",
        "settings.privacy.note.title": "说明",
        "settings.privacy.note.body": "内容保护是展示与外发层面的保护,不是密钥管理器或脚本沙箱。已被「隐私剪贴板」标记拦截的内容仍不会被存储;已授权的脚本规则仍按现有安全边界接收原文。",
        "protection.badge.tooltip": "包含敏感内容,已脱敏展示",
        "common.edit": "编辑",
        "rule.sourceApp": "脚本",
        "rule.toast.ran": "已运行规则",
        "rule.toast.failed": "规则执行失败:",
        "settings.rules.intro.title": "规则与脚本",
        "settings.rules.intro.row": "工作方式",
        "settings.rules.intro.subtitle": "每条规则 = 匹配条件 + 动作。命中后自动执行,也可在条目上右键手动运行。",
        "settings.rules.folder.row": "脚本目录",
        "settings.rules.folder.subtitle": "Shell 脚本(.sh)放在这里,在动作中按文件名引用。",
        "settings.rules.folder.open": "打开脚本目录",
        "settings.rules.list.title": "规则",
        "settings.rules.list.subtitle": "按顺序对每条新剪贴板内容求值;drop 会中断后续规则。",
        "settings.rules.empty": "还没有规则。",
        "settings.rules.add": "新增规则",
        "settings.rules.log.title": "最近运行",
        "settings.rules.log.subtitle": "脚本运行的审计记录(本次会话内)。",
        "settings.rules.log.clear": "清空",
        "settings.rules.authorize.title": "允许该规则运行代码?",
        "settings.rules.authorize.message": "启用后,这条规则会对捕获到的剪贴板内容自动执行脚本。请确认你信任它。",
        "settings.rules.authorize.confirm": "允许并启用",
        "settings.rules.action.drop": "丢弃",
        "settings.rules.action.replaceRegex": "正则替换",
        "settings.rules.action.shell": "Shell 脚本",
        "settings.rules.action.javascript": "JavaScript",
        "settings.rules.action.drop.desc": "命中的剪贴板内容将被排除,不进入历史。",
        "settings.rules.editor.title": "编辑规则",
        "settings.rules.editor.name": "名称",
        "settings.rules.editor.namePlaceholder": "例如:JSON 美化",
        "settings.rules.editor.match": "匹配条件(需全部满足)",
        "settings.rules.editor.regexPlaceholder": "内容正则,留空表示不限",
        "settings.rules.editor.regexInvalid": "正则表达式无效",
        "settings.rules.editor.minLen": "最小长度",
        "settings.rules.editor.maxLen": "最大长度",
        "settings.rules.editor.action": "动作",
        "settings.rules.editor.scriptHint": "该动作会运行代码",
        "settings.rules.editor.find": "查找(正则)",
        "settings.rules.editor.replace": "替换为(支持 $1)",
        "settings.rules.editor.jsHint": "可写表达式或 function run(clip){…};返回字符串=替换,返回 {text,tags,title,drop}=富动作。",
        "settings.rules.editor.noScripts": "脚本目录为空,先放入 .sh 文件。",
        "settings.tab.merge": "合并",
        "settings.tab.mcp": "MCP",
        "settings.tab.ai": "AI",
        "settings.tab.data": "数据",
        "settings.tab.about": "关于",

        "settings.mcp.title": "MCP 服务器",
        "settings.mcp.enable": "启用 MCP 服务器",
        "settings.mcp.enable.subtitle": "允许 Claude Desktop、Claude Code 等 MCP 客户端查询本地剪贴板历史",
        "settings.mcp.config.title": "客户端配置",
        "settings.mcp.config.subtitle": "复制下方 JSON 粘贴到 MCP 客户端的配置文件",
        "settings.mcp.copyButton": "一键复制配置",
        "settings.mcp.copied": "MCP 配置已复制",
        "settings.mcp.tools.title": "可用工具",
        "settings.mcp.tools.search_clipboard.desc": "搜索剪贴板历史。优先使用本地语义嵌入排序,失败时回退到关键字匹配。",
        "settings.mcp.tools.list_recent.desc": "列出最近的剪贴板条目,可按类型过滤。",
        "settings.mcp.tools.get_clip.desc": "根据 UUID 获取单条剪贴板条目,返回完整内容与元数据。",
        "settings.mcp.tools.list_tags.desc": "列出所有已用标签及各自的条目数量。",
        "settings.mcp.tools.list_recent_activity.desc": "列出指定时间点之后新增的条目,适合让模型按时间区间写汇总。",
        "settings.mcp.tools.tag_clip.desc": "给某条剪贴板条目追加标签(与现有标签合并)。",
        "settings.mcp.tools.untag_clip.desc": "从某条剪贴板条目移除指定标签。",
        "settings.mcp.tools.favorite_clip.desc": "设置或取消某条条目的收藏状态。",
        "settings.mcp.tools.pin_clip.desc": "设置或取消某条条目的置顶状态。",
        "settings.mcp.tools.delete_clip.desc": "删除某条条目,默认软删除到回收站,可选彻底删除。",
        "settings.mcp.tools.restore_clip.desc": "把某条已软删除的条目从回收站恢复。",
        "settings.mcp.tools.create_snippet.desc": "新建一条片段条目,可附带标题和标签。",

        // settings: general
        "settings.language.title": "界面语言",
        "settings.language.subtitle": "切换后立即预览界面语言，保存后永久生效",
        "settings.language.system": "跟随系统",
        "settings.theme.title": "外观主题",
        "settings.theme.subtitle": "选择应用的外观主题，立即生效",
        "settings.theme.light": "浅色",
        "settings.theme.dark": "深色",
        "settings.theme.system": "跟随系统",
        "settings.accent.title": "主题色",
        "settings.accent.subtitle": "选择应用强调色，立即应用到按钮、图标和高亮",
        "settings.accent.sage":     "鼠尾草",
        "settings.accent.clay":     "陶土",
        "settings.accent.amber":    "琥珀",
        "settings.accent.lavender": "雾紫",
        "settings.accent.teal":     "雾青",
        "settings.accent.blue":     "经典蓝",
        "settings.window.title": "窗口行为",
        "settings.window.launchAtLogin": "开机自启",
        "settings.window.launchAtLogin.subtitle": "登录系统时自动运行 剪迹",
        "settings.window.showInDock": "在 Dock 中显示",
        "settings.window.showInDock.subtitle": "关闭后应用以菜单栏方式存在，不占用 Dock",
        "settings.window.menuBarIcon": "显示菜单栏图标",
        "settings.window.menuBarIcon.subtitle": "在系统菜单栏右侧展示快捷入口",
        "settings.window.hideFromCapture": "屏幕录制中隐藏",
        "settings.window.hideFromCapture.subtitle": "开启后剪贴板窗口不会出现在录屏、屏幕共享或截图中",
        "settings.window.confirmBeforeQuit": "退出前确认",
        "settings.window.confirmBeforeQuit.subtitle": "按下 ⌘Q 或点击退出时先弹出确认提示",
        "settings.window.dynamicIsland": "灵动岛",
        "settings.window.dynamicIsland.subtitle": "在内建刘海屏刘海下方展示入口；复制新内容时向下展开提示面板",
        "settings.window.trimTrailing": "复制时清理末尾空白",
        "settings.window.trimTrailing.subtitle": "再次复制历史条目时自动去除末尾的空格、换行，常见于代码片段",
        "settings.preview.title": "预览",
        "settings.preview.videoMode.title": "视频预览",
        "settings.preview.videoMode.subtitle": "选择预览弹窗中视频条目的展示方式",
        "settings.preview.videoMode.firstFrame": "首帧",
        "settings.preview.videoMode.video": "视频",
        "settings.preview.videoMuted": "静音播放",
        "settings.preview.videoMuted.subtitle": "视频模式下打开预览时自动静音播放",
        "settings.preview.menuBarHover": "菜单栏悬停预览",
        "settings.preview.menuBarHover.subtitle": "鼠标在菜单栏面板的条目上悬停片刻后，在面板一侧弹出完整预览",
        "settings.preview.quickPasteHover": "快速粘贴停留预览",
        "settings.preview.quickPasteHover.subtitle": "键盘焦点或鼠标在快速粘贴面板的条目上停留片刻后，在面板一侧弹出完整预览",
        "settings.preview.delay.halfSecond": "0.5 秒",
        "settings.preview.delay.oneSecond": "1 秒",
        "settings.preview.delay.oneAndHalfSeconds": "1.5 秒",
        "settings.preview.delay.twoSeconds": "2 秒",
        "settings.preview.delay.threeSeconds": "3 秒",
        "settings.preview.delay.fiveSeconds": "5 秒",
        "settings.storage.title": "数据存储",
        "settings.storage.maxRecords": "最大记录数",
        "settings.storage.maxRecords.subtitle": "超过该上限时会自动清理最旧的内容",
        "settings.storage.maxRecordsFormat": "%d 条",
        "settings.storage.maxRecordsUnit": "条",
        "settings.storage.pollInterval": "监听间隔",
        "settings.storage.pollInterval.subtitle": "降低间隔反应更快，但会增加 CPU 占用",
        "settings.poll.halfSecond": "0.5 秒",
        "settings.poll.oneSecond": "1 秒",
        "settings.poll.twoSeconds": "2 秒",
        "settings.poll.fiveSeconds": "5 秒",
        "settings.semantic.title": "语义搜索",
        "settings.semantic.toggle": "启用语义搜索",
        "settings.semantic.subtitle": "基于本地模型按含义查找剪贴板内容，向量在本机生成不上传",
        "settings.semantic.indexing.title": "正在建立语义索引",
        "settings.semantic.indexing.subtitle.format": "已处理 %1$d / %2$d 条历史记录",
        "settings.semantic.indexing.idle": "已就绪",
        "settings.fda.title": "完全磁盘访问",
        "settings.fda.subtitle": "授权后读取桌面、下载、文稿等位置的文件不会再弹窗",
        "settings.fda.openPrefs": "打开系统设置",
        "settings.fda.viewOnboarding": "重新查看引导",

        // settings: shortcut
        "settings.shortcut.group.title": "全局快捷键",
        "settings.shortcut.openMainWindow": "打开主窗口",
        "settings.shortcut.openMainWindow.subtitle": "全局热键，激活主窗口并置前",
        "settings.shortcut.openQuickPaste": "弹出快速粘贴浮窗",
        "settings.shortcut.openQuickPaste.subtitle": "在鼠标位置弹出浮窗，多选后自动粘贴到当前应用",
        "settings.shortcut.quickPasteCommit": "快速粘贴触发键",
        "settings.shortcut.quickPasteCommit.subtitle": "在快速粘贴浮窗中用 ↑↓ 选中条目后，按此键复制并粘贴到当前应用（仅浮窗内生效，不占用全局快捷键）",
        "settings.shortcut.quickPasteCommit.recording": "请按下按键…",
        "settings.shortcut.recording": "请按下快捷键…",
        "settings.shortcut.empty": "未设置",
        "settings.shortcut.clearTooltip": "清除快捷键",
        "settings.shortcut.quickPasteToggleSelect": "快速粘贴多选键",
        "settings.shortcut.quickPasteToggleSelect.subtitle": "在快速粘贴浮窗中，按此键把当前高亮条目加入或移出多选（按选择顺序粘贴）",
        "settings.shortcut.resetTooltip": "恢复为默认值",
        "settings.shortcut.permission.title": "权限",
        "settings.shortcut.permission.accessibility": "辅助功能权限",
        "settings.shortcut.permission.accessibility.subtitle": "快速粘贴需要此权限才能自动模拟 ⌘V；未授权时会复制到剪贴板由你手动粘贴",
        "settings.shortcut.permission.granted": "已授权",
        "settings.shortcut.permission.notGranted": "尚未授权",
        "settings.shortcut.permission.recheck": "重新检测",
        "settings.shortcut.permission.grant": "授权",
        "settings.shortcut.permission.openPane": "打开辅助功能设置",
        "settings.shortcut.permission.recovery.hint": "已授权但仍显示「尚未授权」？常见原因是旧版本与当前运行的 ClipTrace 不是同一个二进制（开发版 / 不同签名 / 不同位置都算）。请前往 系统设置 → 隐私与安全性 → 辅助功能，移除列表中所有 ClipTrace 条目，再点上方「授权」重新添加当前正在运行的实例。",
        "settings.shortcut.permission.showDiagnostics": "查看当前二进制位置",
        "settings.shortcut.permission.hideDiagnostics": "收起",
        "settings.shortcut.permission.diag.bundlePath": "当前 App 路径",
        "settings.shortcut.permission.diag.bundleId": "Bundle ID",
        "settings.shortcut.permission.diag.note": "辅助功能授权与「路径 + 代码签名」绑定，路径或签名变化会使旧授权失效。",

        // settings: filter
        "settings.filter.link.title": "链接处理",
        "settings.filter.stripTracking": "净化链接",
        "settings.filter.stripTracking.subtitle": "复制 http(s) 链接时自动去除 utm_*、fbclid、gclid 等跟踪参数",
        "settings.filter.tagMode.title": "标签匹配",
        "settings.filter.tagMode.row": "多标签匹配方式",
        "settings.filter.tagMode.subtitle": "搜索栏选中多个标签时的组合方式：任一（OR）或 全部（AND）",
        "settings.filter.apps.title": "排除的应用",
        "settings.filter.apps.subtitle": "来自这些应用的复制内容不会被记录",
        "settings.filter.apps.addButton": "添加应用",
        "settings.filter.apps.chooserTitle": "选择要排除的应用",
        "settings.filter.apps.chooserPrompt": "添加",
        "settings.filter.apps.removedFormat": "已移除应用：%@",
        "settings.filter.apps.addedFormat": "已添加 %d 个应用",
        "settings.filter.types.title": "排除的类型",
        "settings.filter.textRules.title": "文本规则",
        "settings.filter.textRules.subtitle": "可添加多条规则；任一规则匹配即被过滤",
        "settings.filter.textRules.add": "添加规则",
        "settings.filter.textRules.placeholder": "文本",
        "settings.filter.textRules.contains": "包含文本",
        "settings.filter.textRules.excludes": "不包含文本",

        // settings: merge
        "settings.merge.behavior.title": "合并行为",
        "settings.merge.deleteOriginals": "合并后删除原条目",
        "settings.merge.deleteOriginals.subtitle": "开启后，合并将删除被选中的原条目；关闭则保留原条目",
        "settings.merge.enableImageMerge": "图片合并",
        "settings.merge.enableImageMerge.subtitle": "启用后即可对多张图片进行拼接（纵向或横向）",
        "settings.merge.imageParams.title": "图片拼接参数",
        "settings.merge.imageParams.subtitle": "调整方向、背景与图间距",
        "settings.merge.imageParams.direction": "方向",
        "settings.merge.imageParams.background": "背景色",
        "settings.merge.imageParams.spacing": "间距",
        "settings.merge.textSep.title": "文本 / 链接 / 富文本 分隔符",
        "settings.merge.textSep.subtitle": "选择「自定义」时，可使用 \\n 表示换行、\\t 表示制表符",
        "settings.merge.textSep.placeholder": "例如：\\n--\\n",

        // settings: data
        "settings.data.groups.title": "数据分组",
        "settings.data.groups.create": "新建分组",
        "settings.data.groups.subtitle": "用于主窗口、菜单栏和快速粘贴面板的内容分组，可自定义排序与名称。",
        "settings.data.groups.empty": "还没有分组",
        "settings.data.groups.empty.subtitle": "创建分组后，可在条目的右键菜单里把内容移动进去。",
        "settings.data.groups.item.title": "分组",
        "settings.data.groups.item.subtitle": "编辑名称，或用箭头调整显示顺序。",
        "settings.data.trash.title": "垃圾桶",
        "settings.data.trash.enable": "启用垃圾桶",
        "settings.data.trash.enable.subtitle": "开启后，删除的条目会先进入垃圾桶，便于反悔。关闭则直接彻底删除",
        "settings.data.trash.autoClean": "自动清理",
        "settings.data.trash.autoClean.subtitle": "超过期限的条目会被永久删除",
        "settings.data.stats.title": "统计",
        "settings.data.stats.recordCopy": "记录拷贝次数",
        "settings.data.stats.recordCopy.subtitle": "关闭后将不再统计新发生的复制行为，已有数据保留",
        "settings.data.stats.clear.subtitle": "清空所有复制次数记录，热力图与统计将归零",
        "settings.data.retention.title": "自动清理",
        "settings.data.retention.subtitle": "按类型设定保留时长，超期后自动删除。置顶 / 收藏 的条目永远保留",
        "settings.data.export.title": "导出数据",
        "settings.data.export.subtitle": "导出整份历史用于备份",
        "settings.data.export.exportButton": "导出为 JSON",
        "settings.data.export.clearHistory": "清空历史",
        "settings.data.export.clearedHistory": "已清空历史",
        "settings.data.export.clearStats": "清除统计",
        "settings.data.export.clearedStats": "已清除统计",
        "settings.data.clear.title": "清空历史",
        "settings.data.clear.subtitle": "彻底删除所有剪贴板记录（包括收藏、置顶），此操作不可撤销",

        // settings: about
        "settings.about.info.title": "应用信息",
        "settings.about.version": "版本",
        "settings.about.bundleId": "Bundle ID",
        "settings.about.system": "系统",
        "settings.about.versionFormat": "版本 %@",
        "settings.about.links.title": "项目链接",
        "settings.about.repo": "开源仓库",
        "settings.about.repo.open": "前往 GitHub",
        "settings.about.feedback": "反馈 / Issues",
        "settings.about.feedback.subtitle": "提交 Bug 或建议，开发者会在 GitHub 上跟进",
        "settings.about.feedback.open": "提交反馈",
        "settings.about.license": "开源协议",
        "settings.about.license.subtitle": "本项目以 MIT 协议开源，可自由使用、修改与分发",
        "settings.about.acknowledgements.title": "致谢",
        "settings.about.acknowledgements.subtitle": "本应用使用的开源组件",
        "settings.about.acknowledgements.body": "KeyboardShortcuts — 全局快捷键录制\nApple NLEmbedding — 本地语义索引\n感谢所有开源社区的贡献者。",
        "settings.about.acknowledgements.view": "查看全部",
        "settings.about.ack.keyboardShortcuts": "全局快捷键录制",
        "settings.about.ack.sparkle": "应用内自动更新",

        // settings: about / update
        "settings.about.update.title": "检查更新",
        "settings.about.update.subtitle": "通过 GitHub Releases 检查最新版本",
        "settings.about.update.hint": "新版本会自动下载并安装，仅在重启应用时生效。",
        "settings.about.update.check": "立即检查",
        "settings.about.update.available": "发现新版本",
        "settings.about.update.availableFormat": "发现新版本 %@",
        "settings.about.update.install": "立即更新",
        "settings.about.update.installHelp": "下载并安装新版本",
        "settings.about.update.noUpdateFound": "您使用的 %@ 已经是最新版本！",
        "toolbar.update.tip": "发现新版本，点击立即更新",
        "toolbar.update.tipFormat": "发现新版本 %@，点击立即更新",

        // retention durations
        "retention.forever": "永久",
        "retention.oneDay": "1 天",
        "retention.threeDays": "3 天",
        "retention.sevenDays": "7 天",
        "retention.fourteenDays": "14 天",
        "retention.thirtyDays": "30 天",
        "retention.ninetyDays": "90 天",
        "retention.oneEightyDays": "180 天",

        // export panel
        "export.title": "导出为 JSON",
        "export.subtitle": "按筛选条件导出剪贴板历史",
        "export.types.title": "类型",
        "export.types.subtitle": "勾选要导出的内容类型",
        "export.range.title": "时间范围",
        "export.range.from": "从",
        "export.range.to": "到",
        "export.range.allTime": "全部",
        "export.range.today": "今天",
        "export.range.last7": "最近 7 天",
        "export.range.last30": "最近 30 天",
        "export.range.custom": "自定义",
        "export.favorites.title": "收藏与置顶",
        "export.favoriteScope.all": "全部",
        "export.favoriteScope.favorites": "仅收藏",
        "export.favoriteScope.pinned": "仅置顶",
        "export.options.title": "其他选项",
        "export.options.includeImage": "包含图片数据（base64）",
        "export.options.includeImage.subtitle": "文件体积会显著增大；不勾选时仅记录元信息",
        "export.willExportFormat": "将导出 %d / %d 条",
        "export.exportButton": "导出 JSON",
        "export.successFormat": "已导出 %d 条到 %@",
        "export.failedFormat": "导出失败：%@",
        "export.savePanel.title": "导出剪贴板历史",
        "export.batchPanel.prompt": "选择导出目录",

        // menu bar
        "menubar.openSettings": "打开设置",
        "menubar.openMainWindow": "打开主窗口",
        "menubar.empty.noRecords": "暂无记录",
        "menubar.empty.noMatch": "未找到匹配的内容",
        "menubar.shortcutHint": "⌘⇧V 打开主窗口",
        "menubar.recordCountFormat": "%d 条记录",
        "menubar.loadMore": "加载更多",
        "menubar.loadingMore": "正在加载…",
        "menubar.quit": "退出",

        // preview popover
        "preview.cannotImage": "无法预览图片",
        "preview.cannotVideo": "无法预览视频",
        "preview.detection.timestamp": "时间戳解析",
        "preview.detection.base64": "Base64 解码",
        "preview.detection.json": "JSON",
        "preview.utcFormat": "UTC: %@",
        "preview.localFormat": "本地: %@",

        // snippet editor
        "snippet.title": "新建片段",
        "snippet.placeholder": "输入要保存的内容…",
        "snippet.pinAfterSave": "保存后置顶",
        "snippet.savedAndPinned": "片段已保存并置顶",
        "snippet.saved": "片段已保存",

        // quick paste
        "quickpaste.title": "快速粘贴",
        "quickpaste.hint.empty": "点击任一条粘贴，或多选后点按钮",
        "quickpaste.hint.kbdGroup": "分组",
        "quickpaste.hint.kbdMove": "移动",
        "quickpaste.hint.kbdToggle": "选择",
        "quickpaste.hint.kbdPaste": "粘贴",
        "quickpaste.selectedCountFormat": "已选 %d 条",
        "quickpaste.paste": "粘贴",
        "quickpaste.pasteInOrderFormat": "按顺序粘贴 (%d)",
        "quickpaste.emptyClipboard": "剪贴板历史为空",
        "quickpaste.emptyGroup": "当前分组暂无可粘贴内容",
        "quickpaste.emptySearch": "未找到匹配的内容",
        "quickpaste.manualPasteHint": "已复制到剪贴板，请手动 ⌘V。已为你打开「系统设置 → 辅助功能」，请允许 ClipTrace 以启用自动粘贴",

        // trash
        "trash.title": "垃圾桶",
        "trash.captionEmpty": "已删除的条目会先进入这里",
        "trash.captionForeverFormat": "共 %d 条 · 永久保留",
        "trash.captionRetentionFormat": "共 %d 条 · %d 天后自动清理",
        "trash.empty.title": "垃圾桶是空的",
        "trash.empty.subtitle": "从历史中删除条目后会出现在这里，过期会自动清理",
        "trash.emptyButton": "清空垃圾桶",
        "trash.emptyDone": "已清空垃圾桶",
        "trash.deletedAtFormat": "删除于 %@",
        "trash.expiry.soon": "· 即将清理",
        "trash.expiry.hoursFormat": "· %dh 后清理",
        "trash.expiry.daysFormat": "· %dd 后清理",
        "trash.restore": "恢复",
        "trash.restored": "已恢复",
        "trash.purge": "彻底删除",
        "trash.purged": "已彻底删除",

        // stats
        "stats.title": "活跃统计",
        "stats.subtitle": "基于本地剪贴板监听的复制次数",
        "stats.summary.title": "汇总",
        "stats.summary.subtitle": "近期复制行为的整体概览",
        "stats.today": "今日",
        "stats.last7days": "近 7 天",
        "stats.last30days": "近 30 天",
        "stats.total": "总计",
        "stats.heatmap.title": "活跃热力图",
        "stats.heatmap.subtitle": "今年每日复制活跃度",
        "stats.totalCountFormat": "今年共 %d 次复制",
        "stats.legend.less": "少",
        "stats.legend.more": "多",
        "stats.tooltipFormat": "%@ · %d 次",

        // onboarding
        "onboarding.title": "一次授权，告别权限弹框",
        "onboarding.subtitle": "让 剪迹 可以预览任意文件",
        "onboarding.body": "当你复制位于「桌面」「下载」「文稿」「iCloud 云盘」等受保护位置的文件时，macOS 会逐个文件夹弹窗请求授权。\n\n在「系统设置 → 隐私与安全性 → 完全磁盘访问」中打开 剪迹 的开关后，所有此类提示都会消失。",
        "onboarding.step1": "点击下方「打开系统设置」",
        "onboarding.step2": "在列表中找到 剪迹",
        "onboarding.step3": "把右侧开关打开（可能需要解锁）",
        "onboarding.openPrefs": "打开系统设置",
        "onboarding.later": "稍后再说",

        // file chooser
        "file.openWithChooserTitleFormat": "选择应用打开 %@",
        "file.openWithChooserPrompt": "选择",
    ]

    static let en: [String: String] = [
        // common
        "common.copy": "Copy",
        "common.copied": "Copied",
        "common.copiedPlainText": "Copied as plain text",
        "dynamicIsland.copied": "Copied to clipboard",
        "dynamicIsland.openHint": "Open",
        "common.confirmDestructive": "Sure? Click again to confirm",
        "common.confirmTooltip": "Click again to confirm (this can't be undone)",
        "common.clear": "Clear",
        // confirm dialogs
        "confirm.deleteItem.title": "Delete this item?",
        "confirm.deleteItem.message": "It will be moved to Trash, where you can restore it.",
        "confirm.deleteSelected.titleFormat": "Delete %d selected items?",
        "confirm.permanent.message": "This can’t be undone.",
        "confirm.purge.title": "Delete this item forever?",
        "confirm.empty.title": "Empty Trash?",
        "confirm.empty.messageFormat": "This permanently deletes all %d items and can’t be undone.",
        "confirm.clearRange.titleFormat": "Clear “%@”?",
        "confirm.clearRange.softMessage": "Matching items will be moved to Trash.",
        "confirm.deleteAll.title": "Delete all data?",
        "confirm.deleteAll.message": "This permanently erases your entire clipboard history and can’t be undone.",
        "confirm.clearStats.title": "Clear statistics?",
        "confirm.deleteGroup.title": "Delete this group?",
        "confirm.deleteGroup.message": "The group is removed, and its items are kept outside that group. Clipboard content is not deleted.",
        "quit.confirm.title": "Quit ClipTrace?",
        "quit.confirm.message": "Clipboard monitoring will stop until you open the app again.",
        "quit.confirm.button": "Quit",
        "store.reset.notice": "Clipboard history couldn't be opened and was reset to a new database. Your old data was backed up to StoreBackups in the app support folder.",
        "common.delete": "Delete",
        "common.deleted": "Deleted",
        "common.cancel": "Cancel",
        "common.done": "Done",
        "common.save": "Save",
        "common.close": "Close",
        "common.back": "Back",
        "common.unknown": "Unknown",
        "common.unknownSource": "Unknown source",
        "common.notSet": "None added",
        "common.all": "All",
        "common.today": "Today",
        "common.yesterday": "Yesterday",
        "common.preview": "Preview",
        "common.add": "Add",
        "common.remove": "Remove",
        "common.reset": "Reset",
        "common.allTypes": "All types",
        "common.allApps": "All apps",
        "common.search": "Search…",
        "common.searchContent": "Search content…",
        "common.semanticSearch": "Semantic search…",
        "common.tagSearch": "Type to filter tags…",
        "common.searchMode.tag": "Tag",
        "common.searchHint.tooltip": "In Tag mode, type to filter tags, then click or press Return to add one as a filter. Change Any / All matching in Settings → Filters.\nSearch also accepts filters: app:Safari, since:2d, before:2026-05-01.",
        "common.searchMode.full": "Text",
        "common.searchMode.semantic": "Semantic",
        "common.searchMode.indexing": "Indexing…",
        "common.clearSearch": "Clear search",
        "filter.title": "Filters",
        "filter.type": "Type",
        "filter.app": "App",
        "filter.noApps": "No app sources yet",
        "search.semantic.indexing.toast": "Semantic index is still being built — try again shortly",
        "search.semantic.disabled.toast": "Semantic search is disabled in Settings",
        "search.tagPicker.empty": "No matching tags",
        "search.tagPicker.none": "No tags yet · add tags to a list item first",
        "search.tagMode.any": "Any",
        "search.tagMode.all": "All",
        "search.tagMode.tooltip.any": "Match items with any selected tag (union)",
        "search.tagMode.tooltip.all": "Match items that have all selected tags (intersection)",

        // types
        "type.text": "Text",
        "type.image": "Image",
        "type.video": "Video",
        "type.file": "File",
        "type.url": "Link",
        "type.rtf": "Rich Text",

        // tags
        "tag.application": "Application",
        "tag.installer": "Installer",
        "tag.dmg": "Disk Image",
        "tag.ipa": "iOS App",
        "tag.folder": "Folder",
        "tag.audio": "Audio",
        "tag.video": "Video",
        "tag.image": "Image",
        "tag.pdf": "PDF",
        "tag.archive": "Archive",
        "tag.sourceCode": "Source Code",
        "tag.spreadsheet": "Spreadsheet",
        "tag.presentation": "Presentation",
        "tag.html": "HTML",
        "tag.json": "JSON",
        "tag.xml": "XML",
        "tag.rtfFile": "Rich Text File",
        "tag.plainText": "Text File",
        "tag.bundle": "Bundle",

        // remote / source
        "remote.universalClipboard": "Universal Clipboard",
        "snippet.sourceApp": "Snippet",

        // list scope
        "scope.all": "All",
        "scope.favorites": "Favorites",
        "favorites.sort.help": "Sort the favorites list",
        "favorites.sort.dateNewest": "Newest first",
        "favorites.sort.dateOldest": "Oldest first",
        "favorites.sort.name": "By name",
        "favorites.sort.type": "By type",

        // groups
        "group.all": "All data",
        "group.ungrouped": "Unassigned",
        "group.untitled": "Untitled group",
        "group.missing": "Group removed",
        "group.moveTo": "Add to group",
        "group.removeFromGroup": "Remove from all groups",
        "group.removedFromGroup": "Removed from groups",
        "group.addedToFormat": "Added to “%@”",
        "group.removedFromFormat": "Removed from “%@”",
        "group.newAndMove": "New group and move…",
        "group.create": "New group…",
        "group.create.title": "New Group",
        "group.manage": "Manage Groups…",
        "group.manage.title": "Manage Groups",
        "group.manage.subtitle": "Create, rename, or delete groups here. Deleting a group does not delete clipboard items.",
        "group.manage.empty": "No groups yet",
        "group.manage.empty.subtitle": "Enter a name above to create your first group.",
        "group.delete": "Delete Group",
        "group.rename.title": "Rename Group",
        "group.filter.title": "Group Filter",
        "group.editor.subtitle": "Groups appear in your custom Settings order.",
        "group.name.placeholder": "Group name",
        "group.createdFormat": "Created “%@”",
        "group.movedToFormat": "Moved to “%@”",
        "group.deletedFormat": "Deleted group “%@”",
        "group.renamed": "Group renamed",
        "group.filter.help": "Filter by data group",
        "group.moveUp": "Move group up",
        "group.moveDown": "Move group down",
        "group.emptyForMove": "No groups yet",

        // main window
        "main.title": "ClipTrace",
        "main.stat.records": "records",
        "main.stat.favorites": "favorites",
        "main.stat.today": "today",
        "main.empty.title.all": "No clipboard history yet",
        "main.empty.title.favorites": "No favorites yet",
        "main.empty.title.noMatch": "No matching content",
        "main.empty.subtitle.all": "Copy something — text, images, files all work",
        "main.empty.subtitle.favorites": "Tap ☆ on a row to favorite it",
        "main.empty.subtitle.noMatch": "Try a different keyword or type",
        "main.pinnedCountFormat": "Pinned %d",

        // toolbar
        "toolbar.newSnippet": "New snippet",
        "toolbar.multiSelect": "Multi-select",
        "toolbar.exitSelection": "Exit selection",
        "toolbar.filters": "Filters",
        "toolbar.filters.help": "Filter by type or app",
        "toolbar.trash": "Trash",
        "toolbar.stats": "Activity",
        "toolbar.settings": "Settings",

        // monitoring pause toggle
        "monitor.active": "Monitoring",
        "monitor.paused": "Paused",
        "monitor.pause.tooltip": "Pause clipboard monitoring — new clips won't be recorded",
        "monitor.resume.tooltip": "Resume clipboard monitoring",

        // bulk trash shortcuts
        "trash.clearLast.sectionTitle": "Quick clear",
        "trash.clearLast.sectionHintSoft": "Soft-deletes recent clips into the trash; pinned / favorited rows are kept",
        "trash.clearLast.sectionHintHard": "Permanently deletes recent clips; pinned / favorited rows are kept",
        "trash.clearLast.fiveMin": "Last 5 min",
        "trash.clearLast.fifteenMin": "Last 15 min",
        "trash.clearLast.oneHour": "Last 1 h",
        "trash.clearLast.today": "Today",
        "trash.clearLast.custom": "Custom",
        "trash.customRange.title": "Custom clear range",
        "trash.customRange.start": "Start",
        "trash.customRange.end": "End",
        "datetime.year": "Year",
        "datetime.month": "Mon",
        "datetime.day": "Day",
        "datetime.hour": "Hour",
        "datetime.minute": "Min",
        "datetime.second": "Sec",
        "trash.clearLast.empty": "Nothing recent to clear",
        "trash.clearLast.doneFormat": "Removed %d items",

        // rename
        "rename.title": "Rename clip",
        "rename.subtitle": "Set a custom title for this clip. Leave empty to restore the default.",

        // selection / merge
        "selection.selectedFormat": "Selected %d/%d",
        "selection.selectAll": "Select all",
        "selection.clear": "Clear",
        "selection.invert": "Invert",
        "selection.mergeCountFormat": "Merge %d",
        "selection.deleteCountFormat": "Delete %d",
        "selection.deletedFormat": "Deleted %d",
        "selection.moveToGroup": "Move group",
        "selection.movedToGroupFormat": "Moved %d items to “%@”",
        "selection.removedFromGroupFormat": "Removed %d items from groups",
        "selection.merging": "Merging…",
        "selection.mergedFormat": "Merged %d",
        "selection.mergedSuffix.deleted": " (originals removed)",
        "selection.requireTwo": "Select at least two",
        "selection.requireSameType": "Selected types differ and cannot be merged",
        "selection.imageMergeDisabled": "Image merge is off (Settings → Merge)",
        "selection.mergeFailed": "Merge failed",
        "merge.sourceLabelFormat": "Merged (%d)",
        "merge.previewTextFormat": "[Merged %d items] ",
        "merge.previewFileFormat": "[Merged %d files] ",
        "merge.imageContentFormat": "[Stitched %d images · %dKB]",
        "merge.imagePlaceholderFormat": "[Image %dKB]",
        "merge.rtfPlaceholder": "[Rich Text]",

        // merge presets
        "merge.sep.doubleNewline": "Blank line",
        "merge.sep.newline": "Newline",
        "merge.sep.space": "Space",
        "merge.sep.comma": "Comma",
        "merge.sep.semicolon": "Semicolon",
        "merge.sep.tab": "Tab",
        "merge.sep.custom": "Custom",
        "merge.dir.vertical": "Vertical",
        "merge.dir.horizontal": "Horizontal",
        "merge.bg.transparent": "Transparent",
        "merge.bg.white": "White",
        "merge.bg.black": "Black",

        // actions
        "action.copy": "Copy",
        "action.copyAsPlainText": "Copy as Plain Text",
        "action.rename": "Rename…",
        "action.preview": "Preview",
        "action.pin": "Pin",
        "action.unpin": "Unpin",
        "action.favorite": "Favorite",
        "action.unfavorite": "Unfavorite",
        "action.openInBrowser": "Open in Browser",
        "action.saveImage": "Save Image…",
        "action.ocr": "Recognize Text",
        "action.qrPreview": "QR Preview",
        "action.scanCodes": "Scan QR/Barcode",
        "action.encoding": "Encode / Decode",
        "action.base64Encode": "Base64 Encode",
        "action.base64Decode": "Base64 Decode",
        "action.base64Encoded": "Base64 result copied",
        "action.base64Decoded": "Decoded text copied",
        "action.base64DecodeFailed": "Not valid Base64 text",
        "action.runRule": "Run rule: %@",
        "ocr.title": "Image Text Recognition",
        "ocr.recognizing": "Recognizing…",
        "ocr.empty": "No text recognized",
        "ocr.copyAll": "Copy All",
        "ocr.noImage": "Unable to load image",
        "ocr.rotateLeft": "Rotate Left",
        "ocr.rotateRight": "Rotate Right",
        "ocr.resetView": "Reset View",
        "ocr.text.title": "Recognized Text",
        "ocr.text.copy": "Copy shown text",
        "ocr.tab.plain": "Plain Text",
        "ocr.tab.structured": "Structured",
        "barcode.title": "QR & Barcode Scanner",
        "barcode.scanning": "Scanning…",
        "barcode.empty": "No QR code or barcode found",
        "barcode.noImage": "Unable to load image",
        "barcode.results": "Results",
        "barcode.copyAll": "Copy All Results",
        "barcode.copyValue": "Copy Value",
        "barcode.confidenceFormat": "%.0f%% confidence",
        "qr.title": "Text QR Preview",
        "qr.generating": "Generating QR code…",
        "qr.unableToGenerate": "Unable to generate a QR code for this text",
        "qr.scanHint": "Scan with a phone or QR reader to read the text",
        "qr.sourceText": "Source Text",
        "qr.byteCountFormat": "%d bytes",
        "qr.copyText": "Copy Text",
        "qr.copyImage": "Copy QR Image",
        "qr.copiedImage": "QR image copied",
        "action.editTags": "Edit Tags",
        "tags.title": "Tags",
        "tags.placeholder": "Add a tag…",
        "tags.empty": "No tags yet",
        "action.revealInFinder": "Reveal in Finder",
        "action.openFile": "Open File",
        "action.openWith": "Open With…",
        "action.exportOne": "Export…",
        "action.delete": "Delete",
        "action.pinned": "Pinned",
        "action.unpinned": "Unpinned",
        "action.favorited": "Added to favorites",
        "action.unfavorited": "Removed from favorites",

        // settings
        "settings.title": "Settings",
        "settings.tab.general": "General",
        "settings.tab.shortcut": "Shortcuts",
        "settings.tab.filter": "Filters",
        "settings.tab.rules": "Scripts",
        "settings.tab.privacy": "Privacy",
        // Content Protection
        "settings.privacy.title": "Content Protection",
        "settings.privacy.master": "Enable Content Protection",
        "settings.privacy.master.subtitle": "Redact sensitive values like phone numbers and API keys across the list, previews, menu bar, Dynamic Island, Quick Paste, exports, and MCP. The original stays on this Mac; copy/paste and other reuse actions are unaffected.",
        "settings.privacy.rules.title": "Detection Rules",
        "settings.privacy.rules.subtitle": "The built-in phone-number and app-key rules can be edited or turned off, and you can add your own keyword or regex rules. Matches are shown redacted while the original stays intact.",
        "settings.privacy.rule.builtin.phone": "Phone numbers",
        "settings.privacy.rule.builtin.key": "App keys / tokens",
        "settings.privacy.rules.reset": "Restore the default pattern",
        "settings.privacy.customRules.add": "Add Rule",
        "settings.privacy.customRules.mode.contains": "Contains keyword",
        "settings.privacy.customRules.mode.regex": "Regular expression",
        "settings.privacy.customRules.placeholder.contains": "Keyword to redact",
        "settings.privacy.customRules.placeholder.regex": "Regular expression pattern",
        "settings.privacy.customRules.invalidRegex": "Invalid regular expression — this rule is inactive",
        "settings.privacy.egress.title": "Raw egress",
        "settings.privacy.rawExport": "Include raw sensitive content in exports",
        "settings.privacy.rawExport.subtitle": "When off, protected clips export redacted and flagged as protected. Turn on only when you explicitly need the originals.",
        "settings.privacy.rawMCP": "Return raw sensitive content over MCP",
        "settings.privacy.rawMCP.subtitle": "When off, MCP tools return redacted content with protected metadata by default. Turn on only when you explicitly need the originals.",
        "settings.privacy.note.title": "Note",
        "settings.privacy.note.body": "Content Protection guards display and egress; it is not a secret manager or a script sandbox. Content rejected by the concealed-pasteboard filter is still never stored, and authorized script rules still receive raw content within the existing security boundary.",
        "protection.badge.tooltip": "Contains sensitive content — shown redacted",
        "common.edit": "Edit",
        "rule.sourceApp": "Script",
        "rule.toast.ran": "Ran rule",
        "rule.toast.failed": "Rule failed:",
        "settings.rules.intro.title": "Rules & Scripts",
        "settings.rules.intro.row": "How it works",
        "settings.rules.intro.subtitle": "Each rule = match conditions + an action. Matches run automatically; you can also run a rule manually from a clip's right-click menu.",
        "settings.rules.folder.row": "Scripts folder",
        "settings.rules.folder.subtitle": "Put shell scripts (.sh) here and reference them by filename in an action.",
        "settings.rules.folder.open": "Open scripts folder",
        "settings.rules.list.title": "Rules",
        "settings.rules.list.subtitle": "Evaluated in order against each new clip; a drop halts the rest.",
        "settings.rules.empty": "No rules yet.",
        "settings.rules.add": "Add rule",
        "settings.rules.log.title": "Recent runs",
        "settings.rules.log.subtitle": "An audit trail of script runs (this session).",
        "settings.rules.log.clear": "Clear",
        "settings.rules.authorize.title": "Let this rule run code?",
        "settings.rules.authorize.message": "Once enabled, this rule automatically runs its script against captured clipboard content. Only enable it if you trust it.",
        "settings.rules.authorize.confirm": "Allow & enable",
        "settings.rules.action.drop": "Drop",
        "settings.rules.action.replaceRegex": "Regex replace",
        "settings.rules.action.shell": "Shell script",
        "settings.rules.action.javascript": "JavaScript",
        "settings.rules.action.drop.desc": "Matching clips are excluded and never stored in history.",
        "settings.rules.editor.title": "Edit rule",
        "settings.rules.editor.name": "Name",
        "settings.rules.editor.namePlaceholder": "e.g. Pretty-print JSON",
        "settings.rules.editor.match": "Match conditions (all must hold)",
        "settings.rules.editor.regexPlaceholder": "content regex, leave empty for any",
        "settings.rules.editor.regexInvalid": "Invalid regular expression",
        "settings.rules.editor.minLen": "Min length",
        "settings.rules.editor.maxLen": "Max length",
        "settings.rules.editor.action": "Action",
        "settings.rules.editor.scriptHint": "This action runs code",
        "settings.rules.editor.find": "Find (regex)",
        "settings.rules.editor.replace": "Replace with ($1 supported)",
        "settings.rules.editor.jsHint": "Write an expression or function run(clip){…}. Return a string = replace; return {text,tags,title,drop} = rich effect.",
        "settings.rules.editor.noScripts": "Scripts folder is empty — add a .sh file first.",
        "settings.tab.merge": "Merge",
        "settings.tab.mcp": "MCP",
        "settings.tab.ai": "AI",
        "settings.tab.data": "Data",
        "settings.tab.about": "About",

        "settings.mcp.title": "MCP Server",
        "settings.mcp.enable": "Enable MCP Server",
        "settings.mcp.enable.subtitle": "Let Claude Desktop, Claude Code and other MCP clients query your local clipboard history",
        "settings.mcp.config.title": "Client Config",
        "settings.mcp.config.subtitle": "Copy the JSON below into your MCP client's config file",
        "settings.mcp.copyButton": "Copy Config",
        "settings.mcp.copied": "MCP config copied",
        "settings.mcp.tools.title": "Available Tools",
        "settings.mcp.tools.search_clipboard.desc": "Search clipboard history. Uses local sentence embeddings for semantic ranking when possible, falls back to keyword matching.",
        "settings.mcp.tools.list_recent.desc": "List the most recent clipboard entries, optionally filtered by type.",
        "settings.mcp.tools.get_clip.desc": "Fetch a single clipboard entry by UUID, returning full content plus metadata.",
        "settings.mcp.tools.list_tags.desc": "List every tag in use along with how many entries carry it.",
        "settings.mcp.tools.list_recent_activity.desc": "List entries added since a given time — handy for time-bounded summaries.",
        "settings.mcp.tools.tag_clip.desc": "Add tags to a clipboard entry (merged with its existing tags).",
        "settings.mcp.tools.untag_clip.desc": "Remove the given tags from a clipboard entry.",
        "settings.mcp.tools.favorite_clip.desc": "Set or clear an entry's favorite state.",
        "settings.mcp.tools.pin_clip.desc": "Set or clear an entry's pinned state.",
        "settings.mcp.tools.delete_clip.desc": "Delete an entry — soft-delete to trash by default, or purge permanently.",
        "settings.mcp.tools.restore_clip.desc": "Restore a soft-deleted entry from the trash.",
        "settings.mcp.tools.create_snippet.desc": "Create a snippet entry, optionally with a title and tags.",

        // settings: general
        "settings.language.title": "Language",
        "settings.language.subtitle": "Switch instantly to preview; saved permanently.",
        "settings.language.system": "System",
        "settings.theme.title": "Appearance",
        "settings.theme.subtitle": "Choose an appearance theme. Applied immediately.",
        "settings.theme.light": "Light",
        "settings.theme.dark": "Dark",
        "settings.theme.system": "System",
        "settings.accent.title": "Accent Color",
        "settings.accent.subtitle": "Picks the tint used by buttons, icons and highlights. Applied instantly.",
        "settings.accent.sage":     "Sage",
        "settings.accent.clay":     "Clay",
        "settings.accent.amber":    "Amber",
        "settings.accent.lavender": "Lavender",
        "settings.accent.teal":     "Teal",
        "settings.accent.blue":     "Classic Blue",
        "settings.window.title": "Window Behavior",
        "settings.window.launchAtLogin": "Launch at login",
        "settings.window.launchAtLogin.subtitle": "Start ClipTrace automatically on login",
        "settings.window.showInDock": "Show in Dock",
        "settings.window.showInDock.subtitle": "When off, runs as a menu bar app only",
        "settings.window.menuBarIcon": "Show menu bar icon",
        "settings.window.menuBarIcon.subtitle": "Quick entry in the right side of the system menu bar",
        "settings.window.hideFromCapture": "Hide from screen recording",
        "settings.window.hideFromCapture.subtitle": "Excludes the window from screen recordings, sharing, and screenshots",
        "settings.window.confirmBeforeQuit": "Confirm before quitting",
        "settings.window.confirmBeforeQuit.subtitle": "Show a confirmation prompt before ⌘Q or the Quit button closes the app",
        "settings.window.dynamicIsland": "Dynamic Island",
        "settings.window.dynamicIsland.subtitle": "Shows an entry below the notch on the built-in display; new copies expand downward into a panel.",
        "settings.window.trimTrailing": "Trim trailing whitespace on copy",
        "settings.window.trimTrailing.subtitle": "Removes trailing spaces and newlines when re-copying history (handy for code)",
        "settings.preview.title": "Preview",
        "settings.preview.videoMode.title": "Video preview",
        "settings.preview.videoMode.subtitle": "Choose how video clips appear in the preview popover",
        "settings.preview.videoMode.firstFrame": "First frame",
        "settings.preview.videoMode.video": "Video",
        "settings.preview.videoMuted": "Mute playback",
        "settings.preview.videoMuted.subtitle": "Automatically play video previews muted",
        "settings.preview.menuBarHover": "Menu bar hover preview",
        "settings.preview.menuBarHover.subtitle": "Hover over a menu bar panel row for a moment to pop a full preview beside the panel",
        "settings.preview.quickPasteHover": "Quick Paste dwell preview",
        "settings.preview.quickPasteHover.subtitle": "Rest the keyboard focus or pointer on a Quick Paste row for a moment to pop a full preview beside the panel",
        "settings.preview.delay.halfSecond": "0.5 s",
        "settings.preview.delay.oneSecond": "1 s",
        "settings.preview.delay.oneAndHalfSeconds": "1.5 s",
        "settings.preview.delay.twoSeconds": "2 s",
        "settings.preview.delay.threeSeconds": "3 s",
        "settings.preview.delay.fiveSeconds": "5 s",
        "settings.storage.title": "Storage",
        "settings.storage.maxRecords": "Max records",
        "settings.storage.maxRecords.subtitle": "Older entries are pruned once the limit is reached",
        "settings.storage.maxRecordsFormat": "%d records",
        "settings.storage.maxRecordsUnit": "records",
        "settings.storage.pollInterval": "Polling interval",
        "settings.storage.pollInterval.subtitle": "Lower is faster but increases CPU use",
        "settings.semantic.title": "Semantic Search",
        "settings.semantic.toggle": "Enable semantic search",
        "settings.semantic.subtitle": "Find clips by meaning using on-device sentence embeddings — vectors never leave your Mac",
        "settings.semantic.indexing.title": "Building semantic index",
        "settings.semantic.indexing.subtitle.format": "Processed %1$d / %2$d historical items",
        "settings.semantic.indexing.idle": "Ready",
        "settings.poll.halfSecond": "0.5 s",
        "settings.poll.oneSecond": "1 s",
        "settings.poll.twoSeconds": "2 s",
        "settings.poll.fiveSeconds": "5 s",
        "settings.fda.title": "Full Disk Access",
        "settings.fda.subtitle": "Once granted, reading files from Desktop, Downloads, Documents, etc. won't prompt",
        "settings.fda.openPrefs": "Open System Settings",
        "settings.fda.viewOnboarding": "View walkthrough again",

        // settings: shortcut
        "settings.shortcut.group.title": "Global Shortcuts",
        "settings.shortcut.openMainWindow": "Open main window",
        "settings.shortcut.openMainWindow.subtitle": "Global hotkey; brings the main window forward",
        "settings.shortcut.openQuickPaste": "Open quick paste",
        "settings.shortcut.openQuickPaste.subtitle": "Floating panel at the cursor — multi-select pastes into the focused app",
        "settings.shortcut.quickPasteCommit": "Quick Paste trigger key",
        "settings.shortcut.quickPasteCommit.subtitle": "Inside the Quick Paste panel, select an item with ↑↓ then press this to paste it into the focused app (panel-only — never a global hotkey)",
        "settings.shortcut.quickPasteCommit.recording": "Press a key…",
        "settings.shortcut.recording": "Press shortcut…",
        "settings.shortcut.empty": "Not set",
        "settings.shortcut.clearTooltip": "Clear shortcut",
        "settings.shortcut.quickPasteToggleSelect": "Quick Paste multi-select key",
        "settings.shortcut.quickPasteToggleSelect.subtitle": "In the Quick Paste panel, press this to add or remove the highlighted item from the multi-selection (pasted in pick order)",
        "settings.shortcut.resetTooltip": "Restore default",
        "settings.shortcut.permission.title": "Permissions",
        "settings.shortcut.permission.accessibility": "Accessibility",
        "settings.shortcut.permission.accessibility.subtitle": "Required to synthesize ⌘V; without it Quick Paste only copies to the clipboard",
        "settings.shortcut.permission.granted": "Granted",
        "settings.shortcut.permission.notGranted": "Not granted",
        "settings.shortcut.permission.recheck": "Re-check",
        "settings.shortcut.permission.grant": "Grant",
        "settings.shortcut.permission.openPane": "Open Accessibility settings",
        "settings.shortcut.permission.recovery.hint": "Granted but still shows \"Not granted\"? macOS keys Accessibility to a specific binary path + code signature, so a Debug build is a different entry from a Release install. Open System Settings → Privacy & Security → Accessibility, remove every ClipTrace row in the list, then click \"Grant\" above to re-add the currently running instance.",
        "settings.shortcut.permission.showDiagnostics": "Show current app path",
        "settings.shortcut.permission.hideDiagnostics": "Hide",
        "settings.shortcut.permission.diag.bundlePath": "Bundle path",
        "settings.shortcut.permission.diag.bundleId": "Bundle ID",
        "settings.shortcut.permission.diag.note": "Accessibility permission is bound to the binary's path and code signature; any change invalidates the previous grant.",

        // settings: filter
        "settings.filter.link.title": "Links",
        "settings.filter.stripTracking": "Sanitize links",
        "settings.filter.tagMode.title": "Tag Matching",
        "settings.filter.tagMode.row": "Multi-tag matching",
        "settings.filter.tagMode.subtitle": "How multiple selected tags combine in the search bar: Any (OR) or All (AND)",
        "settings.filter.stripTracking.subtitle": "Strip utm_*, fbclid, gclid and other trackers from copied http(s) URLs",
        "settings.filter.apps.title": "Excluded Apps",
        "settings.filter.apps.subtitle": "Copies from these apps are never recorded",
        "settings.filter.apps.addButton": "Add app",
        "settings.filter.apps.chooserTitle": "Choose app to exclude",
        "settings.filter.apps.chooserPrompt": "Add",
        "settings.filter.apps.removedFormat": "Removed app: %@",
        "settings.filter.apps.addedFormat": "Added %d apps",
        "settings.filter.types.title": "Excluded Types",
        "settings.filter.textRules.title": "Text Rules",
        "settings.filter.textRules.subtitle": "Add multiple rules; any match filters the clip",
        "settings.filter.textRules.add": "Add rule",
        "settings.filter.textRules.placeholder": "Text",
        "settings.filter.textRules.contains": "Contains",
        "settings.filter.textRules.excludes": "Does not contain",

        // settings: merge
        "settings.merge.behavior.title": "Merge Behavior",
        "settings.merge.deleteOriginals": "Delete originals after merging",
        "settings.merge.deleteOriginals.subtitle": "When on, merging deletes the selected source entries",
        "settings.merge.enableImageMerge": "Image merging",
        "settings.merge.enableImageMerge.subtitle": "Stitch multiple images vertically or horizontally",
        "settings.merge.imageParams.title": "Stitching Parameters",
        "settings.merge.imageParams.subtitle": "Direction, background and spacing",
        "settings.merge.imageParams.direction": "Direction",
        "settings.merge.imageParams.background": "Background",
        "settings.merge.imageParams.spacing": "Spacing",
        "settings.merge.textSep.title": "Text / Link / Rich Text Separator",
        "settings.merge.textSep.subtitle": "When \"Custom\" is selected, \\n is newline and \\t is tab",
        "settings.merge.textSep.placeholder": "e.g. \\n--\\n",

        // settings: data
        "settings.data.groups.title": "Data Groups",
        "settings.data.groups.create": "New group",
        "settings.data.groups.subtitle": "Organize content across the main window, menu-bar panel, and Quick Paste. Names and order are customizable.",
        "settings.data.groups.empty": "No groups yet",
        "settings.data.groups.empty.subtitle": "Create a group, then move items into it from a row’s context menu.",
        "settings.data.groups.item.title": "Group",
        "settings.data.groups.item.subtitle": "Edit the name, or use the arrows to change display order.",
        "settings.data.trash.title": "Trash",
        "settings.data.trash.enable": "Enable trash",
        "settings.data.trash.enable.subtitle": "Deleted entries go to the trash first so you can undo. Off means immediate hard delete.",
        "settings.data.trash.autoClean": "Auto-clean",
        "settings.data.trash.autoClean.subtitle": "Trashed items past the retention window are permanently deleted",
        "settings.data.stats.title": "Statistics",
        "settings.data.stats.recordCopy": "Record copy counts",
        "settings.data.stats.recordCopy.subtitle": "When off, new copies are not counted; historical data is kept",
        "settings.data.stats.clear.subtitle": "Wipe all copy counts. The heatmap and statistics will reset to zero.",
        "settings.data.retention.title": "Auto-clean",
        "settings.data.retention.subtitle": "Set retention per type. Pinned/favorited entries are exempt.",
        "settings.data.export.title": "Export Data",
        "settings.data.export.subtitle": "Back up the full history for safekeeping",
        "settings.data.export.exportButton": "Export to JSON",
        "settings.data.export.clearHistory": "Clear history",
        "settings.data.export.clearedHistory": "History cleared",
        "settings.data.export.clearStats": "Clear stats",
        "settings.data.export.clearedStats": "Stats cleared",
        "settings.data.clear.title": "Clear History",
        "settings.data.clear.subtitle": "Permanently delete every clipboard record (including favorites and pinned). This cannot be undone.",

        // settings: about
        "settings.about.info.title": "App Info",
        "settings.about.version": "Version",
        "settings.about.bundleId": "Bundle ID",
        "settings.about.system": "System",
        "settings.about.versionFormat": "Version %@",
        "settings.about.links.title": "Project Links",
        "settings.about.repo": "Source Repository",
        "settings.about.repo.open": "Open on GitHub",
        "settings.about.feedback": "Feedback / Issues",
        "settings.about.feedback.subtitle": "Report bugs or suggest features — tracked on GitHub Issues",
        "settings.about.feedback.open": "Open Issues",
        "settings.about.license": "License",
        "settings.about.license.subtitle": "Released under the MIT License — free to use, modify and distribute",
        "settings.about.acknowledgements.title": "Acknowledgements",
        "settings.about.acknowledgements.subtitle": "Open-source components used in this app",
        "settings.about.acknowledgements.body": "KeyboardShortcuts — global hotkey recorder\nApple NLEmbedding — on-device semantic index\nThanks to all contributors of the open-source community.",
        "settings.about.acknowledgements.view": "View all",
        "settings.about.ack.keyboardShortcuts": "Global hotkey recording",
        "settings.about.ack.sparkle": "In-app auto-updates",

        // settings: about / update
        "settings.about.update.title": "Check for Updates",
        "settings.about.update.subtitle": "Look for new releases on GitHub",
        "settings.about.update.hint": "Updates download and install automatically, applied next launch.",
        "settings.about.update.check": "Check Now",
        "settings.about.update.available": "New version available",
        "settings.about.update.availableFormat": "New version %@ available",
        "settings.about.update.install": "Update Now",
        "settings.about.update.installHelp": "Download and install the new version",
        "settings.about.update.noUpdateFound": "You're using %@, which is already the latest version!",
        "toolbar.update.tip": "A new version is available — click to update now",
        "toolbar.update.tipFormat": "Version %@ is available — click to update now",

        // retention durations
        "retention.forever": "Forever",
        "retention.oneDay": "1 day",
        "retention.threeDays": "3 days",
        "retention.sevenDays": "7 days",
        "retention.fourteenDays": "14 days",
        "retention.thirtyDays": "30 days",
        "retention.ninetyDays": "90 days",
        "retention.oneEightyDays": "180 days",

        // export panel
        "export.title": "Export to JSON",
        "export.subtitle": "Export clipboard history filtered by your selection",
        "export.types.title": "Types",
        "export.types.subtitle": "Select content types to include",
        "export.range.title": "Date Range",
        "export.range.from": "From",
        "export.range.to": "To",
        "export.range.allTime": "All time",
        "export.range.today": "Today",
        "export.range.last7": "Last 7 days",
        "export.range.last30": "Last 30 days",
        "export.range.custom": "Custom",
        "export.favorites.title": "Favorites & Pinned",
        "export.favoriteScope.all": "All",
        "export.favoriteScope.favorites": "Favorites only",
        "export.favoriteScope.pinned": "Pinned only",
        "export.options.title": "Options",
        "export.options.includeImage": "Include image data (base64)",
        "export.options.includeImage.subtitle": "File size grows considerably; off keeps only metadata",
        "export.willExportFormat": "Will export %d / %d",
        "export.exportButton": "Export JSON",
        "export.successFormat": "Exported %d records to %@",
        "export.failedFormat": "Export failed: %@",
        "export.savePanel.title": "Export Clipboard History",
        "export.batchPanel.prompt": "Choose Destination",

        // menu bar
        "menubar.openSettings": "Open settings",
        "menubar.openMainWindow": "Open main window",
        "menubar.empty.noRecords": "No records",
        "menubar.empty.noMatch": "No matches",
        "menubar.shortcutHint": "⌘⇧V opens main window",
        "menubar.recordCountFormat": "%d records",
        "menubar.loadMore": "Load more",
        "menubar.loadingMore": "Loading…",
        "menubar.quit": "Quit",

        // preview popover
        "preview.cannotImage": "Cannot preview image",
        "preview.cannotVideo": "Cannot preview video",
        "preview.detection.timestamp": "Timestamp",
        "preview.detection.base64": "Base64 decode",
        "preview.detection.json": "JSON",
        "preview.utcFormat": "UTC: %@",
        "preview.localFormat": "Local: %@",

        // snippet editor
        "snippet.title": "New Snippet",
        "snippet.placeholder": "Enter content to save…",
        "snippet.pinAfterSave": "Pin after save",
        "snippet.savedAndPinned": "Snippet saved and pinned",
        "snippet.saved": "Snippet saved",

        // quick paste
        "quickpaste.title": "Quick Paste",
        "quickpaste.hint.empty": "Click to paste, or multi-select then press the button",
        "quickpaste.hint.kbdGroup": "group",
        "quickpaste.hint.kbdMove": "move",
        "quickpaste.hint.kbdToggle": "select",
        "quickpaste.hint.kbdPaste": "paste",
        "quickpaste.selectedCountFormat": "Selected %d",
        "quickpaste.paste": "Paste",
        "quickpaste.pasteInOrderFormat": "Paste in order (%d)",
        "quickpaste.emptyClipboard": "Clipboard history is empty",
        "quickpaste.emptyGroup": "No pasteable items in this group",
        "quickpaste.emptySearch": "No matches",
        "quickpaste.manualPasteHint": "Copied — paste manually with ⌘V. Opened System Settings → Accessibility so you can enable ClipTrace for auto-paste.",

        // trash
        "trash.title": "Trash",
        "trash.captionEmpty": "Deleted entries land here first",
        "trash.captionForeverFormat": "%d items · kept forever",
        "trash.captionRetentionFormat": "%d items · auto-cleaned after %d days",
        "trash.empty.title": "Trash is empty",
        "trash.empty.subtitle": "Items deleted from history show up here and auto-clean on expiry",
        "trash.emptyButton": "Empty Trash",
        "trash.emptyDone": "Trash emptied",
        "trash.deletedAtFormat": "Deleted %@",
        "trash.expiry.soon": "· cleaning soon",
        "trash.expiry.hoursFormat": "· in %dh",
        "trash.expiry.daysFormat": "· in %dd",
        "trash.restore": "Restore",
        "trash.restored": "Restored",
        "trash.purge": "Delete forever",
        "trash.purged": "Permanently deleted",

        // stats
        "stats.title": "Activity",
        "stats.subtitle": "Copy counts measured by local clipboard monitoring",
        "stats.summary.title": "Summary",
        "stats.summary.subtitle": "Overview of recent copy activity",
        "stats.today": "Today",
        "stats.last7days": "Last 7 days",
        "stats.last30days": "Last 30 days",
        "stats.total": "Total",
        "stats.heatmap.title": "Activity Heatmap",
        "stats.heatmap.subtitle": "Daily copy activity this year",
        "stats.totalCountFormat": "%d copies this year",
        "stats.legend.less": "Less",
        "stats.legend.more": "More",
        "stats.tooltipFormat": "%@ · %d copies",

        // onboarding
        "onboarding.title": "One-time grant, no more permission popups",
        "onboarding.subtitle": "Let ClipTrace preview any file",
        "onboarding.body": "When you copy files in protected locations like Desktop, Downloads, Documents, or iCloud Drive, macOS prompts for permission folder by folder.\n\nEnable ClipTrace in System Settings → Privacy & Security → Full Disk Access to silence all such prompts.",
        "onboarding.step1": "Click \"Open System Settings\" below",
        "onboarding.step2": "Find ClipTrace in the list",
        "onboarding.step3": "Toggle the switch on (you may need to unlock)",
        "onboarding.openPrefs": "Open System Settings",
        "onboarding.later": "Later",

        // file chooser
        "file.openWithChooserTitleFormat": "Choose app to open %@",
        "file.openWithChooserPrompt": "Choose",
    ]
}
