Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
5f635a4c0This file is pinned to the selected release. Download the original to open it in your design tool.
const FALLBACK_MESSAGES = {
'action.tryAltium': 'Try Altium sample',
'action.tryKicad': 'Try KiCad sample',
'app.brandAria': 'Return to ECAD Forge landing page',
'app.open': 'Open local files',
'bom.designators': 'Designators',
'bom.empty': 'No BOM rows were recovered from this file.',
'bom.pattern': 'Pattern',
'bom.quantity': 'Qty',
'bom.source': 'Source',
'bom.value': 'Value',
'chip.localParsing': 'Local parsing',
'chip.noAccount': 'No account',
'chip.noServerUpload': 'No server upload',
'diagnostics.messagesSuffix': 'messages',
'diagnostics.none': 'No diagnostics were emitted for this file.',
'diagnostics.title': 'Parser diagnostics',
'empty.copy':
'Supports .SchDoc, .PcbDoc, .PrjPcb, .json, .kicad_pro and .kicad_pcb. Your files stay on your device.',
'empty.title': 'Drop a design file here or start with a sample project',
'github.open': 'Open Git URL',
'link.localParsing': 'How local parsing works',
'link.pcbStyler': 'Need clean assembly images? Try PCB Styler',
'link.privacy': 'Privacy & security',
'link.supportedFormats': 'Supported formats',
'pcbStyler.export': 'Export or reopen in PCB Styler',
'pcbStyler.dismiss': 'Close PCB Styler tip',
'pcbStyler.open': 'Open this board in PCB Styler',
'pcbStyler.prompt': 'Need clean assembly images for documentation?',
'pcbView.boardSideAria': 'PCB board side',
'pcbView.copyDiagnostic': 'Copy diagnostic message',
'pcbView.copyMeasurementBounds': 'Copy measurement bounds',
'pcbView.exportMeasurementBoundsPng': 'Export bounds PNG',
'pcbView.exportMeasurementBoundsSvg': 'Export bounds SVG',
'pcbView.hoverFocus': 'Focus hover',
'pcbView.measureBounds': 'Measure bounds',
'pcbView.measureClear': 'Clear measurement',
'pcbView.measureDistance': 'Measure distance',
'pcbView.mechanicalDrawings': 'Mechanical drawings',
'pcbView.resetView': 'Reset PCB view',
'pcbView.selectMeasurementBounds': 'Select contents',
'pcbView.traceLengths': 'Trace lengths',
'pcbView.viewSettings': 'PCB view settings',
'pcbView.zoomMeasurementBounds': 'Zoom to bounds',
'preview.demoNoDiagnostics':
'The demo file did not emit parser diagnostics.',
'preview.groupedRows': 'grouped rows',
'preview.label': 'Preview',
'preview.loading': 'Preparing preview',
'preview.loadingDetail': 'The selected demo view is loading.',
'preview.markupUnavailable': 'Preview markup could not be extracted.',
'preview.noCompatibleDemo': 'No compatible demo document was found.',
'preview.noDiagnostics': 'No diagnostics',
'preview.noDiagnosticsEmitted': 'No diagnostics emitted.',
'preview.parserFindings': 'Parser findings available.',
'preview.placementsSuffix': 'placements',
'preview.recoveredFromBoard': 'Recovered from the current board.',
'preview.recoveredFromSheet': 'Recovered from the current sheet.',
'preview.unavailable': 'Unavailable',
'scene3d.boardEnvelopeSuffix': 'mil board envelope',
'scene3d.boardPosition': 'Board position',
'scene3d.bodyPosition': 'Body position',
'scene3d.bodyRotation': 'Body rotation',
'scene3d.bomGroups': 'BOM groups',
'scene3d.bottom': 'Bottom',
'scene3d.companionModelsHint':
'Companion models will be used when matching STEP, WRL, GLB, GLTF, STL, or OBJ files are loaded in the session.',
'scene3d.componentInspector': 'Component inspector',
'scene3d.componentsSuffix': 'components',
'scene3d.controlsAria': '3D detail toggles',
'scene3d.copperDetail': 'Copper detail',
'scene3d.designator': 'Designator',
'scene3d.downloadModelsZip': 'Download Models ZIP',
'scene3d.downloaded': 'Downloaded',
'scene3d.entries': 'entries',
'scene3d.entry': 'entry',
'scene3d.exportAssemblyStep': 'Export STEP assembly',
'scene3d.exportAssemblyWrl': 'Export WRL assembly',
'scene3d.exportAssemblyGlb': 'Export GLB assembly',
'scene3d.exportFailed': 'Model ZIP export failed:',
'scene3d.externalModel': 'External model',
'scene3d.externalModels': 'External models',
'scene3d.fallbackBody': 'Fallback body',
'scene3d.fallbackBodies': 'Fallback bodies',
'scene3d.footprint': 'Footprint',
'scene3d.inspectPrompt': 'Click a component to inspect it.',
'scene3d.interactiveViewAria': 'Interactive 3D PCB view',
'scene3d.isometric': 'Isometric',
'scene3d.loading': 'Preparing 3D scene...',
'scene3d.model': 'Model',
'scene3d.modelFile': 'model file',
'scene3d.modelFiles': 'model files',
'scene3d.modelRotation': 'Model rotation',
'scene3d.mountSide': 'Mount side',
'scene3d.noMetadataFor': 'No metadata is available for',
'scene3d.noModelsForExport':
'No supported 3D models were resolved for export.',
'scene3d.noPcb': '3D preview is available after loading a PCB document.',
'scene3d.pattern': 'Pattern',
'scene3d.picked': 'Picked',
'scene3d.placements': 'Placements',
'scene3d.pointerHint':
'Drag pans in Top/Bottom and orbits in Isometric; right-drag uses the alternate action. Use the wheel to zoom.',
'scene3d.offset': 'Offset',
'scene3d.rotation': 'Rotation',
'scene3d.resetTransform': 'Reset',
'scene3d.scale': 'Scale',
'scene3d.skipped': 'Skipped',
'scene3d.source': 'Source',
'scene3d.startFailed': '3D preview could not start:',
'scene3d.stillPreparing': '3D scene is still preparing.',
'scene3d.title': '3D preview',
'scene3d.to': 'to',
'scene3d.toolbarAria': '3D camera presets',
'scene3d.top': 'Top',
'scene3d.touchHint':
'One-finger drag pans in Top/Bottom and orbits in Isometric. Pinch to zoom.',
'scene3d.unresolved': 'unresolved',
'viewport.interactWithView': 'Interact with view',
'summary.activeFileAria': 'Current file summary',
'summary.boardEnvelope': 'Board envelope',
'summary.bomGroups': 'BOM groups',
'summary.clientSideJs': 'Client-side JS',
'summary.components': 'Components',
'summary.document': 'Document',
'summary.formats': 'Formats',
'summary.graphics': 'Graphics',
'summary.layers': 'Layers',
'summary.lineSegments': 'Line segments',
'summary.noFile': 'No file loaded',
'summary.outlineSegments': 'Outline segments',
'summary.parser': 'Parser',
'summary.placements': 'Placements',
'summary.records': 'records',
'summary.status': 'Status',
'summary.tabsReady': '5 tabs ready',
'summary.texts': 'Texts',
'summary.views': 'Views',
'summary.waitingForFile': 'Waiting for file',
'sidebar.aria': 'Viewer sidebar',
'sidebar.asset': 'Asset',
'sidebar.assets': 'Session assets',
'sidebar.boardOverview': 'Board overview',
'sidebar.boardProperties': 'Board properties',
'sidebar.back': 'Back',
'sidebar.components': 'Components',
'sidebar.copyComponentName': 'Copy component name',
'sidebar.copyNetName': 'Copy net name',
'sidebar.footprints': 'Footprints',
'sidebar.front': 'Front',
'sidebar.help': 'Help',
'sidebar.helpInspect': 'Inspect parser diagnostics and document metadata.',
'sidebar.helpOpen': 'Open local files, folders, samples, or Git sources.',
'sidebar.helpSwitch':
'Switch documents and viewer panels without reloading.',
'sidebar.hide': 'Hide sidebar',
'sidebar.info': 'Info',
'sidebar.infoDimensions': 'Dimensions',
'sidebar.infoHeight': 'Height',
'sidebar.infoSize': 'Size',
'sidebar.infoTitle': 'Title',
'sidebar.infoWidth': 'Width',
'sidebar.lastUpdated': 'Last updated',
'sidebar.layerGroupAdhesive': 'Adhesive',
'sidebar.layerGroupCopper': 'Copper',
'sidebar.layerGroupDrawings': 'Drawings',
'sidebar.layerGroupMechanical': 'Mechanical',
'sidebar.layerGroupPasteMask': 'Paste Mask',
'sidebar.layerGroupSilkscreen': 'Silkscreen',
'sidebar.layerGroupSolderMask': 'Solder Mask',
'sidebar.layerGroupUser': 'User Layers',
'sidebar.layerOnly': 'Only',
'sidebar.layerOnlyGroupTitle': 'Show only {group} layers',
'sidebar.layerOnlyTitle': 'Show only layer: {layer}',
'sidebar.layerToggleGroupTitle': 'Toggle layer group visibility: {group}',
'sidebar.layerToggleTitle': 'Toggle layer visibility: {layer}',
'sidebar.layers': 'Layers',
'sidebar.model3d': '3D model',
'sidebar.model3dEmpty':
'Select a component in the 3D preview to edit its model parameters.',
'sidebar.model3dOpen3d':
'Open the 3D view and select a component to edit its model parameters.',
'sidebar.model3dSelected': 'Selected component',
'sidebar.model3dExport': 'Export selected part',
'sidebar.model3dExportAltium': 'Altium ZIP',
'sidebar.model3dExportCircuitJson': 'CircuitJSON ZIP',
'sidebar.model3dExportKicad': 'KiCad ZIP',
'sidebar.nets': 'Nets',
'sidebar.noComponents': 'No component entries were recovered.',
'sidebar.noDocument': 'No document is loaded.',
'sidebar.noDocuments': 'No open documents.',
'sidebar.noLayers': 'No PCB layer metadata was recovered.',
'sidebar.noNets': 'No net metadata was recovered.',
'sidebar.noObjects': 'No object counts are available.',
'sidebar.objects': 'Objects',
'sidebar.objectFills': 'Fills',
'sidebar.objectAnchorOffsets': 'Anchor offsets',
'sidebar.objectBottomComponents': 'Bottom components',
'sidebar.objectCourtyards': 'Courtyards',
'sidebar.objectFabrication': 'Fabrication',
'sidebar.objectFootprintText': 'Footprint text',
'sidebar.objectGrid': 'Grid',
'sidebar.objectGroups': 'Groups',
'sidebar.objectPage': 'Page',
'sidebar.objectPads': 'Pads',
'sidebar.objectRatsNest': 'Rats nest',
'sidebar.objectSilkscreen': 'Silkscreen',
'sidebar.objectSolderMask': 'Solder mask',
'sidebar.objectSolderPaste': 'Solder paste',
'sidebar.objectThroughHoles': 'Through holes',
'sidebar.objectPins': 'Pins',
'sidebar.objectTexts': 'Texts',
'sidebar.objectTopComponents': 'Top components',
'sidebar.objectTracks': 'Tracks',
'sidebar.objectVias': 'Vias',
'sidebar.objectZones': 'Zones',
'sidebar.openDocuments': 'Open documents',
'sidebar.otherSide': 'Other',
'sidebar.pageProperties': 'Page properties',
'sidebar.preferences': 'Preferences',
'sidebar.preferenceDensity': 'Panel density',
'sidebar.preferenceDensityValue': 'Compact',
'sidebar.preferenceSwatches': 'Layer swatches',
'sidebar.preferenceSwatchesValue': 'Visible',
'sidebar.preferenceTheme': 'Theme',
'sidebar.preferenceThemeValue': 'App palette',
'sidebar.presets': 'Presets',
'sidebar.pcbInteraction': 'PCB interaction',
'sidebar.presetAll': 'All',
'sidebar.presetBack': 'Back',
'sidebar.presetCopper': 'Copper',
'sidebar.presetDrawings': 'Drawings',
'sidebar.presetFront': 'Front',
'sidebar.project': 'Project',
'sidebar.properties': 'Properties',
'sidebar.propertyFile': 'File',
'sidebar.propertyType': 'Type',
'sidebar.search': 'search',
'sidebar.searchFootprints': 'Search footprints',
'sidebar.searchLayers': 'Search layers',
'sidebar.searchNets': 'Search nets',
'sidebar.searchSymbols': 'Search symbols',
'sidebar.sheetOverview': 'Sheet overview',
'sidebar.show': 'Show sidebar',
'sidebar.symbols': 'Symbols',
'view.diagnostics': 'Diagnostics',
'view.threeD': '3D',
'view.threeDBoard': '3D board',
'viewStatus.ready': 'Ready for a local file, folder, sample, or Git URL'
}
/**
* Shared fallback-aware translation helpers for renderer-owned UI text.
*/
export class UiText {
/**
* Translates one key with English fallback copy.
* @param {((key: string) => string) | null | undefined} translate
* @param {string} key Message key.
* @returns {string}
*/
static translate(translate, key) {
if (typeof translate !== 'function') {
return UiText.fallback(key)
}
const value = translate(key)
if (!value || value === key) {
return UiText.fallback(key)
}
return value
}
/**
* Creates a stable translator function with English fallback copy.
* @param {((key: string) => string) | null | undefined} translate
* @returns {(key: string) => string}
*/
static createTranslator(translate) {
return (key) => UiText.translate(translate, key)
}
/**
* Returns fallback copy for one key.
* @param {string} key Message key.
* @returns {string}
*/
static fallback(key) {
return FALLBACK_MESSAGES[key] || key
}
}