FAQ
Common Issues
Q: Why did translation fail?
Possible Causes:
- Network connection issues
- Invalid or expired API Key
- Service quota exhausted
Solutions:
- Check network connection
- Verify API Key is correct
- Switch to another translation service
Q: How to switch translation service?
Press Alt+Shift+S or use Command Palette Ctrl+Shift+P → "Switch Translation Service".
Q: How to disable file translation?
Press Alt+Shift+D to toggle the switch, or modify in settings:
json
{
"variableTranslator.enableFileTranslation": false
}Q: Why can't I use the undo feature?
The undo feature is only valid within 1 minute. After 1 minute, the undo record is automatically cleared.
Q: Which languages are supported for translation?
The plugin supports auto-detection and translation of:
- Chinese
- Japanese
- Korean
- Russian
- Any other non-English characters
Q: What if translation result is inaccurate?
- Try switching to another translation service
- Check if the original text has special characters
- For professional terminology, consider using OpenAI service
Q: How to configure translation services?
Configure variableTranslator.services in VSCode settings, see Configuration.
Q: How to get API Key?
| Service | URL | Description |
|---|---|---|
| OpenAI | platform.openai.com/api-keys | Create API Key |
| Baidu Translation | fanyi-api.baidu.com | Enable General Translation API |
| Tencent Translation | console.cloud.tencent.com/cam/capi | Get SecretId/SecretKey |
| Bing/Azure | portal.azure.com | Create Translator resource |
| DeepLX | DeepLX GitHub | Local deployment |
For detailed steps, see Translation Services Documentation.
Q: How is filename conflict handled?
When the target file already exists, the plugin automatically adds a suffix (e.g., test_1.test.js) and prompts the user.
Q: What happens if translation fails?
When translation fails, the plugin automatically degrades to pinyin translation, ensuring the filename is still usable.
Technical Issues
Q: How to build from source?
bash
# Clone the project
git clone https://github.com/AnsStory/hias-variable-translator.git
# Install dependencies
npm install --registry https://registry.npmmirror.com
# Compile
npm run compile
# Build
npm run buildQ: How to debug the plugin?
- Open the project in VSCode
- Press F5 to start debugging
- Test plugin features in the new window
Q: How to contribute code?
- Fork the project
- Create a feature branch
- Submit a Pull Request
Contact
- GitHub Issues: https://github.com/AnsStory/hias-variable-translator/issues