How dphans/vscode_xcode_localization works
Xcode Localization is a VS Code extension for editing Xcode String Catalogs and legacy .strings files in a spreadsheet-style grid. Users open a localization file, the extension prepares a catalog model and sends it to the webview, where they search, filter, review, and edit translations; edits are applied surgically to preserve clean diffs. A separate Localizations view discovers files and reports progress. The README documents code scanning, git change markers, format warnings, notes, and progress; their details are represented at the subsystem level where source excerpts are incomplete.
Main entry points: XcstringsEditorProvider.ts Editor Provider · App.tsx Grid App · extension.ts Extension Activation · Grid.tsx Translation Grid
Components 20
VS Code Extension
- Extension Activation
src/extension.ts - Editor Provider
src/editor/XcstringsEditorProvider.ts - Message Protocol
src/shared/protocol.ts
Catalog and Editing
- Catalog Parser
src/shared/xcstrings.ts - Strings Model
src/editor/stringsModel.ts - Language Grouping
src/editor/lproj.ts - Surgical Editing
src/shared/edit.ts - Search and Filters
src/shared/search.ts - Format Validation
src/shared/format.ts - Git Baseline
src/editor/git.ts
Grid Interface
- Grid App
webview/App.tsx - Translation Grid
webview/Grid.tsx - Language Picker
webview/LanguagePicker.tsx - Change Markers
webview/diff.ts
Workspace Discovery
- Localizations View
src/tree/LocalizationsTreeProvider.ts
Other components
- Translator
- VS Code
- Localization Files
- Git HEAD
- Swift / Obj-C Code
Connections 28
- Translator → VS Code: opens file
- VS Code → Extension Activation: activates
- Extension Activation → Editor Provider: registers editor
- Extension Activation → Localizations View: registers view
- VS Code → Editor Provider: opens document
- Editor Provider → Localization Files: reads and watches
- Editor Provider → Language Grouping: resolves siblings
- Editor Provider → Strings Model: builds legacy model
- Editor Provider → Catalog Parser: parses catalog
- Editor Provider → Git Baseline: loads baseline
- Git Baseline → Git HEAD: reads committed text
- Editor Provider → Grid App: sends model and updates
- Grid App → Editor Provider: sends edit requests
- Grid App → Message Protocol: uses message types
- Editor Provider → Message Protocol: uses message types
- Grid App → Catalog Parser: parses catalog text
- Grid App → Search and Filters: searches entries
- Grid App → Format Validation: checks specifiers
- Grid App → Translation Grid: renders entries
- Translation Grid → Language Picker: offers language selection
- Translation Grid → Change Markers: shows baseline changes
- Editor Provider → Surgical Editing: computes text edits
- Editor Provider → Localization Files: writes document edits
- Localizations View → Localization Files: scans workspace files
- Localizations View → Editor Provider: opens selected file
- Translator → Grid App: edits and filters
- Grid App → Swift / Obj-C Code: requests code scan
- Grid App → VS Code: requests code search