A Python script that translates text from an Excel column into another language and saves it in an adjacent column.
- Reads from Excel files (.xlsx)
- Translates text using Google Translate API
- Preserves original file and creates a new translated version
- Progress tracking during translation
- Error handling for failed translations
openpyxl googletrans==3.1.0a0
- Clone this repository
- Install required packages: pip install -r requirements.txt
- Place your Excel file in the same directory as the script
- The Excel file should have:
- Column A: Resource
- Column B: Primary Language (text to translate)
- Column C: Translation (where translations will be written)
- Run the script: python excel-translator.py
Check the examples
directory for sample input and output files:
examples/spanish.xlsx
: Sample input fileexamples/spanish_translated.xlsx
: Sample output file showing translations
Resource ID | Primary Language | Translation |
---|---|---|
greeting_1 | Hello | Hola |
weather_1 | It's sunny | Está soleado |
The script creates a new file with '_translated' suffix (e.g., spanish_translated.xlsx
)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.