This for translating Excel files through the Deepl Translator API. Because the Deepl API cannot translate Excel files, this program first copies the text from the Excel file to a txt file, then translates through Deepl, returns the text to a txt file, then places the English text into the 2nd column in the corresponding row of the Excel file. It also adds 'Translated' to the file name.
- Takes an excel document with chunks of Japanese text in to 1st column, and adds a US English translation to the 2nd column
- Adds 'Translated' to the Excel file name
-
Install the required Python packages:
pip install openpyxl deepl
-
Update the following information in the Python script:
- Get an authentication key from deepl and enter it here
authentication_key = "################################". - Replace
'file.xlsx'with the name of the Excel file you wish to translate. Alternatively, change the name of your Excel file tofile.xlsx.
- Get an authentication key from deepl and enter it here
-
Place the Excel file you wish to translate into the same directory as the Python script.
-
Run the script:
python Excel Deepl Translator.py
-
The
output.txtfile will have the translated cells in seperate groups of text.
Excel Deepl Translator.pyPython script for translating excel file to English and saving it asoutput.txt.input.txt: Text file used to hold text from Excel file, and be translated by deepl as a documentoutput.txt: Text file containing translated textfile.xlsx: An Excel file that you wish to translate into English needs to be placed in this directory and name configured in the script or its file name changed tofile.xslx.
Alex McKinley
This project is licensed under the MIT License.
