Locale Trace
A Visual Studio Code extension that helps you find missing JSON keys referenced in your source code and preview translations directly in the editor.
Features
- Missing Key Detection: Finds method calls that reference keys missing from your JSON files.
- Diagnostics: Highlights missing keys directly in your source code.
- Quick Fix: Adds missing keys to the selected JSON file automatically.
- Translation Preview: Displays translations inline without modifying your source code.
- Unsaved Changes Support: Updates analysis using your current editor content, even before saving.
Configuration
Create a .vscode/json-checker.json file in your workspace:
{
"rules": [
{
"name": "Language Entries",
"enabled": true,
"source": {
"include": ["**/*.cs"],
"exclude": ["**/bin/**", "**/obj/**"],
"method": "TextComponent.Translatable",
"argument": 0
},
"target": {
"files": [
"Languages/en_us.json",
"Languages/tr_tr.json"
],
"path": "Entries",
"previewFile": "Languages/en_us.json"
},
"insert": {
"value": ""
}
}
]
}
Configuration Options
| Property |
Description |
name |
Rule name |
enabled |
Enables or disables the rule |
source.include |
Source files to scan |
source.exclude |
Source files to ignore |
source.method |
Method to search for |
source.argument |
Zero-based argument index containing the key |
target.files |
JSON files to check |
target.path |
JSON object path containing the keys |
target.previewFile |
JSON file used for translation previews |
insert.value |
Default value inserted by Quick Fix |
Requirements
- Visual Studio Code 1.146.0 or later
- .NET 10 Runtime
License
See LICENSE for details.
| |