- anki-vocabulary-deck-name
- Specify the Deck used to store the vocabulary card
- anki-vocabulary-model-name
- Specify the model of vocabulary card
- anki-vocabulary-field-alist
- Specify the meaning of fields in the model
- expression
- the vocabulary
- sentence
- the context of vocabulary
- sentence_bold
- the context with vocabulary bold
- translation
- translated context
- glossary
- meaning of vocabulary
- phonetic
- the phonetic symbol
- M-x anki-vocabulary-set-ankiconnect
- Help you settle arguments above
- Select the sentence in which the word is in as the context.
- If the buffer mode is
pdf-view-mode
, you have to mark the context manually. - In other modes, It gets context by
sentence-at-point
and(thing-at-point 'line)
.
- If the buffer mode is
M-x anki-vocabulary
- Pick the vocabulary
It will display the
translation of context(if avaible)
and shows youvocabulary meanings
- Pick the correct meaning in the context
It will create the card automatically
This package use Youdao API (thanks to youdao-dictionary.el) to do the translation.
According to the API Documentation,It will identify Chinese, English, Japanese, Korean, French, Spanish, Portuguese, Russian, Vietnamese, German, Arabic, Indonesian and Italian automatically.
But you can also Specify the original language and target language with following steps.
- you should register a Youdao account and create an application to get an
appKey
and asecret-key
(see the guide(in Chinese)). - set the
youdao-dictionary-app-key
to the value ofappKey
- set the
youdao-dictionary-secret-key
to the value ofsecret-key
- set the
youdao-dictionary-from
to the code of original language - set the
youdao-dictionary-to
to the code of target language
The language | code |
Chinese | zh-CHS |
English | en |
Japanese | ja |
Korean | ko |
French | fr |
Spanish | Es |
Portuguese | pt |
Italian | it |
Russian | ru |
Vietnamese | vi |
German | DE |
Arabic | ar |
Indonesian | id |
Afrikaans | af |
Bosnian | bs |
Bulgarian | bg |
Cantonese | make |
Catalan | ca |
Croatian | hr |
Czech | cs |
Danish | da |
Dutch | nl |
Estonian | et |
Fijian | fj |
Finnish | fi |
Greek | el |
Haitian | Creole ht |
Hebrew | he |
Hindi | hi |
White hmong | mwW |
Hungarian | hu |
Swahili | sw |
Klingon | tlh |
Latvian | lv |
Lithuanian | lt |
Malay | ms |
Maltese | mt |
Norwegian | no |
Persian | fa |
Polish | pl |
Queretaro | otq |
Romanian | ro |
Serbian (Cyrillic) | sr-Cyrl |
Serbian (Latin) | sr-Latn |
Slovak | sk |
Slovenian | sl |
Swedish | sv |
Tahitian | ty |
Thai | th |
Tongan | to |
Turkish | tr |
Ukrainian | uk |
Urdu | ur |
Welsh | cy |
Yucatan Maya | yua |
Albanian | sq |
Amharic | am |
Armenian | hy |
azeri | az |
Bengali | bn |
Basque | eu |
Belarusian | be |
Cebu language | ceb |
Corsican | co |
Esperanto | eo |
Filipino | tl |
Frisian | fy |
Galician | gl |
Georgian | ka |
Gujarat | gu |
Hausa | ha |
Hawaiian | haw |
Icelandic | is |
Ibo | ig |
Irish | ga |
Javanese | jw |
Kannada | kn |
Kazakh | kk |
Khmer | km |
Kurdish | ku |
Kirgiz | ky |
Lao | lo |
Latin | la |
Luxembourg | lb |
Macedonian | mk |
Malgash | mg |
Malayalam | ml |
Maori | mi |
Marathi | mr |
Mongolian | mn |
Burmese | my |
Nepali | ne |
Zichewa | ny |
Pashto | ps |
Punjabi | pa |
Samoan | sm |
Scottish Gaelic | gd |
The sesotho language | st |
Shona | sn |
Sindhi | sd |
Sinhala | si |
Somali | so |
The sunda | su |
Tajik | tg |
Tamil | ta |
telugu | Te |
Uzbek | uz |
Xhosa | xh |
Yiddish | yi |
yoruba | yo |
South African zulu | zu |
Automatic identification | auto |
For example, if you want to translate French to English, you can do the following customization:
(setq youdao-dictionary-app-key "xxxxxxxxxxxxxxx")
(setq youdao-dictionary-secret-key "yyyyyyyyyyyyyyy")
(setq youdao-dictionary-from "fr")
(setq youdao-dictionary-to "en")
;;. Bonjour, je m’appelle Geo et je viens de Chine.
You can define your own function to fetch the meanings of vocabulary and translation of the context.
The function used to get meanings of vocabulary should accept the vocabulary as the argument and return an alist like
`((expression . ,vocabulary-string)
(glossary . ,meanings-of-vocabulary-list)
(phonetic . ,phonetic-string))"
The function used to translate the context should accept the context as the only argument and return the translation in a string.
Then set the anki-vocabulary-word-searcher
to the function that get meanings of vocabulary.
Set the anki-vocabulary-sentence-translator
to the function that get the translation of context.