- Python
pip install azure-ai-translation-text- Azure Cognitives Services subscription (Available in Azure)
Edit these variables in the script:
# Your Azure credentials (already set)
key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
endpoint = "https://XXXXXcognitive.cognitiveservices.azure.com/"
region = "francecentral"
# Source and target languages
source_language = "en"
target_language = ["fr"] # Change to your target language
# File paths
input_file = "path/to/en.template.js"
output_file = "path/to/en.overwrite.js"-
Norwegian Bokmål: "nb"
-
French: "fr"
-
German: "de"
-
Spanish: "es"
-
Italian: "it"
-
Portuguese: "pt"
-
Dutch: "nl"
-
Swedish: "sv"
-
Danish: "da"
-
Finnish: "fi"
-
etc.
-
supported lang https://learn.microsoft.com/en-us/azure/ai-services/translator/language-support
python vspc_azure_translation.py/**
* Copyright © Veeam Software Group GmbH.
*/
(window.VSPC = window.VSPC || {}).localesOverwrite = {};
window.VSPC.localesOverwrite.locale = {
ABOVE: 'Au-dessus',
ABOUT: 'À propos',
ACTION: 'Action',
...
};Benefits:
- ✓ Complete valid JavaScript file
- ✓ Ready to use immediately
- ✓ Proper escaping
- ✓ Correct formatting
Starting translation process...
Step 1: Extracting file structure...
- Found 1250 translation entries
Step 2: Translating entries...
- Progress: 100/1250 entries translated
- Progress: 200/1250 entries translated
...
Step 3: Writing output file...
Translation process completed successfully!
- Validates file structure
- Handles missing translations gracefully
- Reports specific errors with context
- Continues on individual translation failures
To translate to multiple languages at once:
target_languages = ["nb", "sv", "da", "fi"]
for lang in target_languages:
output_file = f"output_{lang}.js"
target_language = [lang]
# Run translationAfter running the script, verify the output:
- Check file opens: Open output.js in text editor
- Validate JavaScript: Load in browser console or check syntax
- Verify structure: Check header and footer are intact
- Spot check translations: Review a few random entries
- Check special chars: Look for entries with quotes, colons, etc.
- Check input file format matches expected structure
- Verify file encoding is UTF-8
- Verify Azure credentials are correct
- Check internet connection
- Verify subscription is active
- Check Azure Translator supports target language
- Verify source text is not empty
- Script uses UTF-8 encoding
- Ensure your editor supports UTF-8
The improved script eliminates ALL manual steps:
- ✗ No pre-cleaning needed
- ✗ No post-processing with Notepad++
- ✗ No manual copy-paste
- ✗ No manual formatting
- ✓ Just run and use!