In Chinese vocabulary Generator Anki Addon, I used python module to translate example sentences but it increases the time for list generation.
So, in this post I will explain how to create database with translation using Google sheets. This will help in creating flashcards offline with sentences and translation. Also it can be used in Anki addon development for language learning.
I will take example of creating Chinese language database.
1. Download the sentences database from tatoeba
2. Open it with Google sheets
3. Use Google Translate function to translate all the sentences.
=GOOGLETRANSLATE(C1, "zh", "en")
4. Select first cell then click CTRL + SHIFT + down arrow, after that click CTRL + D to copy formula to all cell in that column.
5. Wait for sometime to complete the translations
6. Download the sheets as TSV files
7. Use this python script to create sqlite db file from tsv file.
Note: Change the fields and table name as per requirements
Demo
Download language sentences TSV files and generate translations in Google sheets
Create DB file from TSV file
I have already created the database for Chinese language with Simplified, Traditional, Pinyin and Meaning.
You can get the TSV files from GitHub repo.
Comments
Post a Comment