Closed kshitij10496 closed 6 years ago
Should the translation be two-way ? That is to say, both from some language to English and vice-versa ?
Ideally, the user should be able to translate both ways. But for starters, let's keep it simple and try to add one-way translation from English to the user-desired language.
@kshitij10496 I am planning to add a new command like the one below:
lexico translate <word> <src> <dest>
If only three args are given, 'src' will default to English. 'dest' language can be given in both two-character format ('es' for Spanish) or as complete word ('Spanish' for Spanish, ignoring cases). This requires the use of googletrans package (added to setup.py), since Google Cloud Translate API is not free.
Does this work ?
Rather than adding a separate command, let's integrate it in the pager view itself(by modifying the Word
object). We will create a framework for commands later.
What should be the trigger-event for the translation to be done ? I did this the way I had written about earlier and it saves the English word if it's not already present.
Whenever anyone searches a word: $lexico add <some_word>
, the result page should contain a translation along with currently present details.
For now, I can add some default translations for that word. But what should the user do if he wants to do a custom translation that is not present by default ?
@kshitij10496 please review PR #12 for this issue.
Issue closed by #12
@priyanshsaxena Adding a sentence referencing the issue being resolved by a commit is considered a good practice. Also, GitHub automatically closes the related issue when the commit is merged. Refer: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Thanks for the info. I forgot to do that. Thanks for doing this as well. I'll keep this in mind.
Using Google Translate API, we can try to add word translation feature to the application. If someone can share the results of a Proof-Of-Concept(POC), we can discuss further concrete implementation details.