D2R String Translator is a Visual Studio Code extension that simplifies editing and translating JSON files containing multilingual strings for Diablo II Resurrected.
Features
Works only with .json files: The extension operates exclusively on JSON files.
JSON format validation: Automatically checks if the file follows the expected format (an array of objects with language fields).
Editing interface: Opens a webview where JSON data can be structured and edited conveniently.
Automatic ID assignment: Assigns the next available ID to new objects.
Translation function: Automatically translates missing language fields using Google Translate.
JSON export: If the file does not match the expected format, the JSON object is formatted and displayed separately.
Installation
Requirements: Ensure that Visual Studio Code is installed.
Installation from the Marketplace(available in the future):
Search for d2r-string-translator in the VS Code Extension Gallery.
Click "Install".
Manual Installation:
Download the repository and run vsce package.
Install the .vsix file in VS Code via Extensions -> Install from VSIX....
Usage
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P on Mac).
Select the command "D2R: Translate Json String".
If a valid JSON file is open, it will be loaded for editing.
If no file is open or the format is invalid, the JSON object will be displayed separately.
Make changes and click Save to append the object to the file.
Translations can be completed automatically by entering a string and clicking Translate all missing strings.
Extension Settings
This extension does not require any special settings.
Known Issues
Translation failures: If the Google Translate API is unavailable, automatic translation may fail.
Formatting issues: If the JSON file does not precisely match the expected format, the extension cannot save the object directly.
Release Notes
1.0.0
Initial release with core features: JSON validation, editing interface, automatic ID assignment, and translation functionality.
Contributing
Pull requests and feature requests are welcome! Feel free to open an issue in the repository.