Terminal UI (TUI) Editor
December 5, 2025 · View on GitHub
This document provides comprehensive information about LRM's interactive Terminal UI editor for managing localization resources.
Table of Contents
Overview
The Terminal UI (TUI) editor provides a full-screen, keyboard-driven interface for editing .resx resource files. It allows you to view and edit multiple languages side-by-side, translate keys, scan code for usage, and more—all without leaving your terminal.
Key Features:
- Side-by-side multi-language editing
- Real-time search with regex/wildcard support
- In-app translation with 8 provider options
- Code scanning to find unused/missing keys
- Undo/redo support
- Clipboard integration
- Context menus and keyboard shortcuts
- Duplicate key detection and handling
- Visual status indicators
Launching the TUI
# Launch TUI for default resource path
lrm edit
# Specify resource path
lrm edit --path ./Resources
# Specify source path for code scanning
lrm edit --path ./Resources --source-path ./src
# Use configuration file
lrm edit --config-file lrm.json
Options:
-p, --path <PATH>- Path to resource folder (default: current directory)--source-path <PATH>- Path to source code for scanning (default: parent of resource path)--config-file <PATH>- Configuration file path
User Interface Layout
┌─────────────────────────────────────────────────────────────────┐
│ Menu Bar │
├─────────────────────────────────────────────────────────────────┤
│ Search: [________________] [Clear] [x] Regex [x] Wildcard │
│ Language: [All Languages ▼] Status: [All ▼] │
│ │
│ [Scan Code (F7)] [ ] Unused in code [ ] Missing from .resx │
│ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Key │ default │ el │ ... │ Status │ Comment │ │
│ ├─────────────┼─────────┼─────────┼─────┼────────┼──────────┤ │
│ │ HelloWorld │ Hello │ Γεια │ │ │ │ │
│ │ ⚠ Missing │ Test │ │ │ ⚠ │ │ │
│ │ ∅ Unused │ Old │ Παλιό │ │ ∅ │ │ │
│ └─────────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Status Bar: F1 Help | Ctrl+S Save | Esc Quit | 123 keys │
└─────────────────────────────────────────────────────────────────┘
Components:
- Menu Bar - File, Edit, View, Tools, Help menus
- Search Controls - Search field, clear button, regex/wildcard toggles
- Filter Controls - Language dropdown, status filter, code usage filters
- Scan Controls - Code scan button, usage filter checkboxes
- Table View - Multi-column table showing all resource entries
- Status Bar - Quick help and statistics
Keyboard Shortcuts
Navigation
| Key | Action |
|---|---|
↑ / ↓ | Move between rows |
Page Up / Page Down | Scroll page |
Home / End | Jump to first/last row |
Tab / Shift+Tab | Move between controls |
Editing
| Key | Action |
|---|---|
Enter | Edit selected key |
Ctrl+N | Add new key |
Ctrl+T | Translate selected key |
Del | Delete selected key |
Ctrl+Z | Undo last operation |
Ctrl+Y | Redo last operation |
Ctrl+C | Copy selected value to clipboard |
Ctrl+V | Paste value from clipboard |
Batch Operations
| Key | Action |
|---|---|
Space | Toggle selection for current row |
Ctrl+A | Select all visible keys |
Esc | Clear all selections (when rows are selected) |
Shift+↑ | Extend selection upward |
Shift+↓ | Extend selection downward |
Search and Filter
| Key | Action |
|---|---|
/ | Focus search field |
Ctrl+F | Focus search field (alternative) |
F3 | Find next match |
Shift+F3 | Find previous match |
Esc (in search) | Clear search |
Code Scanning
| Key | Action |
|---|---|
F7 | Scan source code for key usage |
Shift+F7 | View code references for selected key |
View
| Key | Action |
|---|---|
Ctrl+D | Show duplicates dialog |
Right-Click | Show context menu for selected row |
File Operations
| Key | Action |
|---|---|
Ctrl+S | Save all changes |
Ctrl+Q / Esc | Quit (prompts if unsaved changes) |
Help
| Key | Action |
|---|---|
F1 | Show help dialog |
Features
Multi-Language Editing
The TUI displays all languages side-by-side in a single table view.
Columns:
- Key - Resource key name (with status icon)
- Language columns - One column per language file
- Status - Visual status indicator (icon)
- Comment - Resource comment/description
Features:
- Automatically discovers all
.resxfiles in resource folder - Default language shown first (configurable via
DefaultLanguageCodein config) - Add/remove languages from menu
- Edit any language's value with
Enterkey
Adding a Language:
Menu → File → Add Language
→ Select language from list → Enter
Removing a Language:
Menu → File → Remove Language
→ Select language → Confirm deletion
Plural Key Support (JSON Backend)
When using the JSON backend, the TUI supports editing plural keys with multiple forms (one, other, zero, etc.).
Identifying Plural Keys:
- Plural keys are displayed with a
[plural]prefix in the table - Example:
[plural] one: {0} item, other: {0} items
Editing Plural Keys:
- Select a plural key and press
Enter - A specialized dialog opens with separate fields for each plural form:
one- Singular formother- Plural form (required)zero- Zero quantity (optional)
- Each language has its own set of plural form fields
- Empty fields are skipped when saving
Plural Forms (CLDR):
zero- Zero quantity (some languages)one- Singular (1 item)two- Dual (2 items)few- Few itemsmany- Many itemsother- Default/plural (required)
Search and Filtering
The TUI provides powerful search and filtering capabilities.
Search Field
- Text search - Type to search keys, values, or comments
- Regex mode - Check "Regex" to enable regex patterns (e.g.,
^Error.*) - Wildcard mode - Check "Wildcard" for glob patterns (e.g.,
Error*) - Clear button - Click or press
Escin search field to clear - Match counter - Shows "X of Y matches" in status bar
Keyboard Navigation:
/orCtrl+F- Focus search fieldF3- Find next matchShift+F3- Find previous match
Search Scope
Configure what to search in via View → Search Scope:
- Keys only
- Values only
- Comments only
- Keys and values
- All fields (keys, values, comments)
Status Filter
Filter by translation status:
- All - Show all keys
- Missing - Keys with empty translations in some languages
- Complete - Keys fully translated in all languages
- Extra - Keys not in default language
- Duplicates - Keys with multiple occurrences
Language Filter
- All Languages - Show all keys
- Specific Language - Show only keys with non-empty value in selected language
Code Usage Filter
After running code scan (F7):
- Unused in code - Show only keys not found in source code
- Missing from .resx - Show only keys used in code but not in
.resxfiles
Note: All filters work together (AND logic). For example, you can search for "Error" AND show only missing translations AND unused in code.
Translation
The TUI integrates machine translation for quick localization.
Translating a Key
- Select a key with missing translations
- Press
Ctrl+Tor Menu → Edit → Translate - Select source and target languages
- Choose translation provider
- Confirm translation
Supported Providers:
- Google Translate
- DeepL
- Azure Translator
- OpenAI GPT
- Anthropic Claude
- Azure OpenAI
- Ollama (local LLM)
- LibreTranslate (self-hosted)
Configuration:
- API keys can be set via environment variables or
lrm.json - Default provider configurable in
lrm.json - Translation is cached (30-day SQLite cache) to reduce API costs
Progress Indicator: During translation, a progress bar shows:
- Current key being translated
- Progress percentage
- Elapsed time
See TRANSLATION.md for detailed provider setup.
Code Scanning
The TUI can scan your source code to identify unused keys and missing keys.
Running a Scan
Press F7 or Menu → Tools → Scan Source Code
A progress dialog shows:
- Number of files scanned
- Scan progress
Scan Results
After scanning, the status bar shows:
🔍 Scanned: 123 files, 456 refs | Unused: 12 | Missing: 3
Status Indicators:
∅- Key exists in.resxbut not used in code (unused)✗- Key used in code but not in.resx(missing)
Filtering: Use the checkboxes to show only:
- Unused in code - Keys to consider removing
- Missing from .resx - Keys to add
Viewing Code References
For keys that are used in code:
- Select the key
- Press
Shift+F7OR Right-click → "View Code References" - See table with file paths, line numbers, patterns, and confidence
Quick Access: Use Shift+F7 to quickly view code references for the selected key without using the mouse.
Scan Configuration:
The scan respects configuration from lrm.json:
{
"Scanning": {
"ResourceClassNames": ["Resources", "Strings", "AppResources"],
"LocalizationMethods": ["GetString", "Translate", "L", "T"]
}
}
See COMMANDS.md for scan command details.
Undo/Redo
The TUI maintains an operation history for undo/redo.
Supported Operations:
- Edit value
- Delete key
- Add key
Keyboard Shortcuts:
Ctrl+Z- Undo last operationCtrl+Y- Redo last undone operation
Menu Access:
- Menu → Edit → Undo
- Menu → Edit → Redo
History Size:
- Default: 50 operations
- When limit is reached, oldest operations are removed
Notes:
- Undo/redo clears when you save or quit
- Operation descriptions shown in menu (e.g., "Undo: Edit 'HelloWorld' in en")
Context Menus
Right-click on any table row to show a context menu.
Available Actions:
- Edit Key (Enter) - Edit the selected key's values
- View Code References - Show code usage (if scanned and key has references)
- Translate (Ctrl+T) - Translate missing values
- Copy Value (Ctrl+C) - Copy selected value to clipboard
- Delete Key (Del) - Delete the key
Note: All context menu actions are also available via keyboard shortcuts or the menu bar.
Clipboard Operations
The TUI supports clipboard integration for copying and pasting values.
Copy Value
- Select a key
- Press
Ctrl+Cor Right-click → "Copy Value" - Value from the currently selected cell is copied to clipboard
Paste Value
- Select a key
- Press
Ctrl+Vor Menu → Edit → Paste Value - Clipboard content is pasted into the selected cell
Use Cases:
- Copy value from one language to another
- Paste from external applications
- Duplicate values quickly
Batch Operations
The TUI supports multi-selection for performing operations on multiple keys at once.
Selecting Multiple Keys
Keyboard Selection:
Space- Toggle selection for current rowCtrl+A- Select all visible keysEsc- Clear all selectionsShift+↑/Shift+↓- Extend selection upward/downward
Visual Indication:
- Selected rows are marked with a
►(arrow) indicator before the key name - Status bar shows selection count:
📋 Selected: 5
Selection Persistence:
- Selections persist across table rebuilds (search, filter, etc.)
- Navigation and filtering won't clear your selection
- Press
Escto explicitly clear selections
Bulk Operations
Once you've selected multiple keys, you can perform batch operations:
Bulk Translate:
- Select keys (using
Space,Ctrl+A, orShift+arrows) - Menu → Edit → Bulk Translate (or use context menu)
- Select source and target languages
- Choose translation provider
- All selected keys are translated in batch
- Progress bar shows translation status
Bulk Delete:
- Select keys to delete
- Menu → Edit → Bulk Delete (or use context menu)
- Confirm deletion dialog shows count of selected entries
- All selected keys are deleted
- Automatic backup created before deletion
Menu Access:
- Menu → Edit → Select All (
Ctrl+A) - Menu → Edit → Clear Selection (
Esc) - Menu → Edit → Bulk Translate
- Menu → Edit → Bulk Delete
Use Cases:
- Translate all error messages at once
- Delete multiple unused keys after code scan
- Select keys by pattern (search first) then bulk translate
- Clean up groups of deprecated keys
Notes:
- Bulk operations respect occurrence numbers for duplicate keys
- Selection count includes all occurrences if duplicates are selected
- Bulk delete creates a backup automatically (operation:
tui-bulk-delete) - No selection = operation shows error message
Duplicate Key Handling
.resx files can have multiple entries with the same key name. LRM tracks these as occurrences.
Visual Indicators:
- Keys with duplicates show a
◆(diamond) icon - Occurrence number shown in dialogs:
Key [1],Key [2], etc.
Viewing Duplicates
- Press
Ctrl+Dor Menu → Tools → Show Duplicates - See table with all duplicate keys and their occurrence counts
- For scanned projects, shows code reference count per duplicate
Editing Duplicates
When editing a duplicate key:
- Dialog shows occurrence number: "Edit 'Key [2]'"
- Each occurrence is edited separately
Deleting Duplicates
When deleting a duplicate key:
- Dialog prompts: "Delete which occurrence?"
- Options:
[1],[2], ...,All - Can delete specific occurrence or all at once
Merging Duplicates
Use the merge-duplicates CLI command to consolidate duplicates:
lrm merge-duplicates --key KeyName --strategy keep-first
See COMMANDS.md for details.
Status Indicators
Each row displays a status icon indicating its state:
| Icon | Status | Meaning |
|---|---|---|
| ⚠ | Missing | Key has empty translations in some languages |
| ⭐ | Extra | Key exists in translation but not in default language |
| ◆ | Duplicate | Multiple entries with the same key name |
| ∅ | Unused in Code | Key exists in .resx but not found in source code (after scan) |
| ✗ | Missing from Resources | Key used in code but not in .resx files (after scan) |
| (none) | Normal | Key is fully translated and used in code |
Priority: When multiple statuses apply, the highest priority is shown:
- Missing from Resources (✗)
- Extra (⭐)
- Duplicate (◆)
- Missing (⚠)
- Unused in Code (∅)
- Normal
Color Coding: Status icons are color-coded for quick visual scanning:
- Red - Critical issues (missing from resources)
- Yellow - Warnings (missing translations, extra keys)
- Cyan - Duplicates
- Gray - Unused keys
- Default - Normal
Comments
Each resource entry can have a comment/description.
Viewing Comments:
- The "Comment" column shows the first 50 characters
- Full comment visible when editing a key
Editing Comments:
- Edit a key (Enter)
- Enter comment in the "Comment" field
- Comments are saved to
.resxfiles as<comment>tags
Use Cases:
- Document key purpose
- Add context for translators
- Store notes about usage
Workflow Examples
Example 1: Translating Missing Keys
- Launch TUI:
lrm edit - Filter by missing: Status dropdown → "Missing"
- Select first key
- Press
Ctrl+Tto translate - Select source/target languages and provider
- Confirm translation
- Repeat for remaining keys
- Press
Ctrl+Sto save
Example 2: Finding and Removing Unused Keys
- Launch TUI:
lrm edit --source-path ./src - Press
F7to scan source code - Check "Unused in code" filter
- Review keys shown
- For each unused key:
- Verify it's truly unused (check comment/context)
- Press
Delto delete or leave if needed
- Press
Ctrl+Sto save
Example 3: Adding a New Language
- Launch TUI:
lrm edit - Menu → File → Add Language
- Select language (e.g., "French (fr)")
- Press
Enterto confirm - New "fr" column appears
- Translate keys using
Ctrl+Tor manually edit - Press
Ctrl+Sto save
Example 4: Batch Translating with Search
- Launch TUI:
lrm edit - Search for keys:
/Error→ Enter - Status filter → "Missing"
- For each result:
- Press
Ctrl+Tto translate - Or manually edit with Enter
- Press
- Press
F3to jump to next match - Repeat until all done
- Press
Ctrl+Sto save
Example 5: Fixing Duplicate Keys
- Launch TUI:
lrm edit - Press
Ctrl+Dto show duplicates - Review duplicate keys and their values
- For each duplicate:
- Note which occurrence to keep
- Close dialog (Esc)
- Search for the key (/)
- Delete unwanted occurrences (Del → select occurrence)
- Press
Ctrl+Sto save
Example 6: Reviewing Code References
- Launch TUI:
lrm edit --source-path ./src - Press
F7to scan code - Select an interesting key
- Right-click → "View Code References"
- Review files, line numbers, and patterns
- Note any issues or refactoring opportunities
- Close dialog (Esc)
Example 7: Bulk Translating Error Messages
- Launch TUI:
lrm edit - Search for error keys:
/Error→ Enter - Status filter → "Missing" (to find untranslated error messages)
- Press
Ctrl+Ato select all visible keys - Menu → Edit → Bulk Translate
- Select source language: "default (en)"
- Select target language: "Greek (el)"
- Choose provider: "Google Translate"
- Confirm translation
- Wait for progress bar to complete
- Press
Escto clear search and review results - Press
Ctrl+Sto save
Example 8: Cleaning Up Unused Keys After Scan
- Launch TUI:
lrm edit --source-path ./src - Press
F7to scan source code - Wait for scan to complete
- Check "Unused in code" filter checkbox
- Review the list of unused keys
- Use
Spaceto toggle selection for keys you want to delete - Or press
Ctrl+Ato select all if you're confident - Menu → Edit → Bulk Delete
- Confirm deletion (shows count of entries to delete)
- Keys are deleted and backup is created
- Uncheck "Unused in code" filter to see remaining keys
- Press
Ctrl+Sto save
Tips and Best Practices
Performance
- For large resource files (1000+ keys), searching and filtering help focus on relevant entries
- Code scanning can take time on large codebases—be patient or exclude directories in scan configuration
Workflow
- Use
Ctrl+Sfrequently to save changes - Run code scan (
F7) regularly to catch unused/missing keys early - Use comments to document complex or context-sensitive keys
- Leverage translation cache—retranslating the same text is instant
Keyboard Efficiency
- Learn the keyboard shortcuts—much faster than using menus
- Use
/to quickly jump to search - Use
F3/Shift+F3to navigate search results - Use
Ctrl+Zliberally—undo is your friend
Code Scanning
- Configure
Scanning.ResourceClassNamesandScanning.LocalizationMethodsinlrm.jsonto match your project's patterns - Review "unused in code" results carefully—some keys may be loaded dynamically
- "Missing from resources" results are usually bugs—add those keys or remove code references
Related Documentation
- COMMANDS.md - Complete CLI command reference
- TRANSLATION.md - Translation provider setup
- CONFIGURATION.md - Configuration file schema
- EXAMPLES.md - More usage examples