Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

11.3 KB
Raw Blame
import json
import os

cache_path = os.path.join(os.path.dirname(__file__), '.translate-cache.json')
with open(cache_path, 'r', encoding='utf-8') as f:
    cache = json.load(f)

# Master English reference
master = {
  "filters": { "all": "All", "text": "Text", "links": "Links", "images": "Images", "files": "Files" },
  "tabs": { "behaviour": "Behaviour", "position": "Position", "appearance": "Appearance" },
  "header": { "searchPlaceholder": "Search history...", "settings": "Settings", "close": "Close", "whatsNew": "What's New" },
  "behaviour": {
    "languageTitle": "Language",
    "languageDesc": "Select UI language for system menus and controls",
    "systemDefault": "System Default (Auto)",
    "launchAtLoginTitle": "Launch at login",
    "launchAtLoginDesc": "Start silently in background when computer boots",
    "incognitoTitle": "Incognito mode",
    "incognitoDesc": "Temporarily pause recording new clipboard items",
    "hoverActivationTitle": "Hover Activation",
    "hoverActivationDescOn": "Slide open shelf when hovering cursor near screen edge",
    "hoverActivationDescOff": "Hover trigger paused. Use Alt + C to open",
    "disabledHoverOff": "Disabled because Hover Activation is turned off",
    "fullscreenProtectionTitle": "Fullscreen Protection",
    "fullscreenProtectionDesc": "Automatically pause edge hover while playing games or watching fullscreen videos",
    "clearUnpinnedTitle": "Clear unpinned on restart",
    "clearUnpinnedDesc": "Wipe unpinned items whenever the app restarts",
    "soundEffectsTitle": "Sound Effects",
    "soundEffectsDesc": "Play tactile audio feedback for toggles, sliders, and button clicks",
    "autoUpdatesTitle": "Automatic updates",
    "autoUpdatesDescOn": "Check for and download app updates automatically in background",
    "autoUpdatesDescOff": "Background update checks paused. Check for updates manually below",
    "checkForUpdates": "Check for updates",
    "checkingForUpdates": "Checking GitHub for updates...",
    "isUpToDate": "✓ Edge-Drop is up to date",
    "checkAgain": "Check again",
    "tryAgain": "Try again",
    "updateCheckFailed": "Update check failed",
    "updateAvailableTitle": "Edge-Drop v{version} is available!",
    "updateAvailableDesc": "A newer version is ready on GitHub. Would you like to download and update now?",
    "downloadAndUpdate": "Download & Update",
    "skip": "Skip",
    "downloadingUpdate": "Downloading update package in background...",
    "updateReadyTitle": "Update v{version} Ready",
    "updateReadyDesc": "Click to restart Edge-Drop and apply the update.",
    "restartToUpdate": "Restart to Update",
    "restartToUpdateBelow": "Restart to update below",
    "newUpdateAvailableBelow": "New update available below",
    "autoDeleteTitle": "Auto-delete timer",
    "autoDeleteDesc": "Automatically purge copied items (preserves Pinned)",
    "never": "Never",
    "capacityTitle": "History capacity",
    "capacityDesc": "Maximum unpinned items stored in history"
  },
  "position": {
    "edgePlacementTitle": "Edge Placement",
    "edgePlacementDesc": "Choose which screen edge Edge-Drop anchors to",
    "leftEdge": "Left Edge",
    "rightEdge": "Right Edge",
    "displayTitle": "Display Screen",
    "displayDesc": "Choose which monitor Edge-Drop attaches to",
    "primaryDisplay": "Primary Display",
    "verticalPositionTitle": "Vertical Position",
    "verticalPositionDesc": "Adjust vertical alignment along screen edge",
    "top": "Top",
    "center": "Center",
    "bottom": "Bottom",
    "triggerZone": "Trigger Zone",
    "edgeLocationHintTitle": "Edge location hint",
    "edgeLocationHintDesc": "Subtly illuminate beacon on screen edge when touching edge at wrong position",
    "edgeTriggerPositionTitle": "Edge trigger position",
    "edgeTriggerPositionDesc": "Placement of hover trigger strip relative to shelf",
    "hoverAreaSizeTitle": "Hover area size",
    "hoverAreaSizeDesc": "Hover area size on the screen edge",
    "medium": "Medium",
    "edgeTriggerThicknessTitle": "Edge trigger thickness",
    "edgeTriggerThicknessDesc": "Physical thickness of the invisible trigger strip",
    "panelHeightTitle": "Panel height",
    "panelHeightDesc": "Vertical size of the clipboard shelf"
  },
  "appearance": {
    "copyIndicatorTitle": "Copy Indicator",
    "copyIndicatorDesc": "Show subtle visual beacon on screen edge when copying",
    "indicatorStyleTitle": "Indicator Style",
    "indicatorStyleDesc": "Choose visual shape style for edge copy indicator",
    "typography": "Typography",
    "textSizeTitle": "Text size",
    "textSizeDesc": "Adjust UI typography scale across Edge-Drop",
    "audioAndFeedback": "Audio & Feedback",
    "small": "Small",
    "normal": "Normal",
    "medium": "Medium",
    "large": "Large",
    "cardViewTitle": "Card Layout",
    "cardViewDesc": "Toggle between modern cards or compact list rows",
    "modernCards": "Modern Cards",
    "compactRows": "Compact Rows",
    "logoStyle": "Logo",
    "tickStyle": "Tick",
    "copyStyle": "Copy",
    "sparkleStyle": "Sparkle"
  },
  "item": {
    "copy": "Copy",
    "pinned": "PINNED",
    "pin": "Pin",
    "unpin": "Unpin",
    "delete": "Delete",
    "clear": "Clear",
    "dropToSave": "Drop to save",
    "dropToSaveDesc": "Any file, image, link, or text",
    "justNow": "just now",
    "ago": "ago",
    "expand": "Expand",
    "textItem": "Text",
    "imageItem": "Image",
    "fileItem": "File",
    "linkItem": "Link",
    "items": "items",
    "recent": "RECENT",
    "expandPinned": "Expand pinned items",
    "collapsePinned": "Collapse pinned items",
    "screenshot": "Screenshot",
    "ungroup": "Ungroup from collection",
    "copyFilePath": "Copy file path",
    "moreImages": "+{count} more images",
    "moreFiles": "+{count} more files",
    "singleFile": "1 file",
    "scrollToTop": "Scroll to top"
  },
  "fileKinds": {
    "pdf": "PDF",
    "word": "Word",
    "excel": "Excel",
    "powerpoint": "Slides",
    "archive": "Archive",
    "text": "Text",
    "code": "Code",
    "audio": "Audio",
    "video": "Video",
    "image": "Image",
    "file": "File"
  },
  "emptyState": {
    "shelfEmpty": "Shelf is empty",
    "noResultsFound": "No results found",
    "shelfEmptyHint": "Copy anything or drop files here to begin",
    "noResultsHint": "Try a different keyword or clear search",
    "noClipsFound": "No {type} found",
    "copyTypeHint": "Copy {type} or switch back to All",
    "textClips": "text clips",
    "links": "links",
    "images": "images",
    "files": "files"
  },
  "onboarding": {
    "welcomeTitle": "Welcome to Edge-Drop",
    "welcomeDesc": "Edge-Drop lives hidden on the left edge of your screen. Simply move your mouse to the left edge to open the panel, and move away to hide it.",
    "collectTitle": "Collect Anything",
    "collectDesc": "Whenever you press Ctrl+C to copy text, images, or files, Edge-Drop automatically catches and saves them in the background.",
    "dragTitle": "Drag & Drop Anywhere",
    "dragDesc": "Need to use an item? Just open the panel and drag the card directly into any application, folder, or document.",
    "stacksTitle": "Explore File Stacks",
    "stacksDesc": "Copying multiple files groups them into a stack. You can drag the entire stack, or click it to view and extract individual files.",
    "ungroupTitle": "Ungroup & Split Stacks",
    "ungroupDesc": "Want to separate items in a stack? Click to expand the stack, then drag any subitem to the left edge of the screen. A glowing coral bar will appear—drop the item on it to extract it back into a standalone card.",
    "mergeTitle": "Combine & Merge Items",
    "mergeDesc": "Combine separate file or image cards by dragging them directly onto each other. This organizes your shelf by bundling related assets into a stack.",
    "previewTitle": "Preview Flyout",
    "previewDesc": "Click the preview button on any card to open a side flyout. Inspect high-resolution images, browse file collections, read long text snippets, or drag items directly from the preview.",
    "configTitle": "Configure Your Clipboard",
    "configDesc": "Customize how Edge-Drop works for you.",
    "skip": "Skip",
    "back": "Back",
    "next": "Next",
    "getStarted": "Get Started",
    "extractedCard": "Extracted card",
    "dropToExtract": "Drop to extract back into a standalone card",
    "proTips": "Pro Tips",
    "proTip1": "Press Alt + C to instantly toggle the shelf.",
    "proTip2": "Access settings anytime via the gear icon (top right).",
    "proTip3": "Drag & drop files to the left edge to add them.",
    "proTip4": "Click a text box, then a clipboard item to auto-paste."
  },
  "tray": {
    "showClipboard": "Show Clipboard",
    "settings": "Settings",
    "incognito": "Incognito (pause capture)",
    "hoverTrigger": "Hover Trigger (open on hover)",
    "stickTo": "Stick to",
    "left": "Left",
    "right": "Right",
    "display": "Display",
    "quit": "Quit Edge-Drop",
    "welcomeTitle": "Edge-Drop Clipboard Shelf",
    "welcomeBody": "Hover against the middle-left screen edge, or press Alt+C to slide open your shelf."
  },
  "flyout": {
    "copyBeaconStyleTitle": "Copy Indicator Style",
    "openLink": "Open Link",
    "copyContent": "Copy Content",
    "saveFile": "Save File",
    "extractedFromBundle": "Extracted from file stack",
    "itemsCount": "{count} items",
    "selectedCount": "{count} Selected",
    "selectAll": "Select All",
    "deselectAll": "Deselect All",
    "copySelected": "Copy Selected",
    "pasteSelected": "Paste Selected",
    "paste": "Paste",
    "clearSelection": "Clear Selection",
    "contentTruncated": "… (content truncated)",
    "clickToPaste": "Click to paste",
    "copyText": "Copy Text",
    "copyImage": "Copy Image",
    "copyFile": "Copy File",
    "clickToPasteDrag": "Click to paste · Drag to move",
    "openInExplorer": "Open in File Explorer",
    "current": "Current"
  },
  "toast": {
    "copiedToClipboard": "Copied to clipboard",
    "itemDeleted": "Item deleted",
    "itemPinned": "Item pinned",
    "itemUnpinned": "Item unpinned",
    "settingsSaved": "Settings saved"
  },
  "footer": {
    "communityAndSupport": "Community & Support",
    "feedbackTitle": "Feedback & Issues",
    "feedbackDesc": "Report a bug or suggest a feature on GitHub",
    "submitFeedback": "Submit Feedback ↗",
    "applicationGroup": "Application",
    "quitTitle": "Quit Edge-Drop",
    "quitDesc": "Exit application and stop background process",
    "starOnGithub": "Star on GitHub",
    "githubPromo": "Enjoying Edge-Drop? Show your support by starring the project on GitHub!",
    "version": "Version"
  }
}

# Language codes to JavaScript variable names
code_map = {
    'en': 'en',
    'es': 'es',
    'fr': 'fr',
    'de': 'de',
    'it': 'it',
    'pt': 'pt',
    'ru': 'ru',
    'ja': 'ja',
    'ko': 'ko',
    'zh-CN': 'zhCN',
    'zh-TW': 'zhTW',
    'hi': 'hi',
    'ar': 'ar',
    'fa': 'fa',
    'bn': 'bn',
    'tr': 'tr',
    'vi': 'vi',
    'pl': 'pl',
    'nl': 'nl',
    'sv': 'sv',
    'id': 'id',
    'uk': 'uk',
    'el': 'el',
    'cs': 'cs',
    'ro': 'ro',
    'hu': 'hu',
    'da': 'da',
    'fi': 'fi',
    'th': 'th',
    'he': 'he',
    'no': 'no'
}

def merge_dict(target):
    res = {}
    for group, keys in master.items():
        res[group] = {}
        for k, v in keys.items():
            res[group][k] = target.get(group, {}).get(k, v) if isinstance(target, dict) else v
    return res

print("Loaded python translation generator.")