Closed dayjaby closed 9 years ago
Thanks for the pull request. Before I accept it, please make the following two changes to your code:
for
loops to search for the tab and newline character use the built in string methods find
and rfind
. There is no need to write code for functionality already built into the standard library.translation_start
and translation_end
should be named translationStart
and translationEnd
to be consistent with the camel-case naming convention for variables in the rest of the code.Thanks for having a look at it! I fixed the mentioned points.
Merged, thanks for the codes ^^
With this small update, yomichan scans the entire line for a tab character. If it finds one, it treats the rest of the line as translation.
E.g. having the line 彼は洞察力のある人だ。\t"He is a man of vision." 彼は洞察力のある人だ。 becomes the definition's sentence "He is a man of vision." becomes the definition's translation.
The proper field for the translation can be set in the preferences with {translation}. I made this update mainly to be able to import sentence lists from tatoeba.com more easily, because they export it with the same pattern like the example above.