cambridge
cambridge copied to clipboard
add other languages for translation
You can make it as an option, which will be substituted in the url of the address.
I thought about that when I added Chinese translation, but found some other language versions of Cambridge seem too simple, not as rich as Chinese version(aka Cambridge English-Chinese (Simplified) Dictionary), which corresponds the english version literally word by word, making it possible to reuse the same formatting for printing the english version to the terminal. I will look into it again, if the html data structure is the same as the English version and the formatting can be reusable, I will do it. Thank you for your suggestion.
Sorry for the late reply. With the New Year season and a new wild wave of covid in China, I didn't feel like updating code in this repo in the past two months. Today I inspected htmls of different language Cambridge dictionaries, and found:
You can make it as an option, which will be substituted in the url of the address.
You can't just simply substitute the url. Changing url didn't work because they are totally different dictionaries with different contents and different number of items, etc. For example:
this is english-to-korean for the word "value"
this is english-to-french for the word "value"
So the parser for english-to-english translation can not be reused for other languages except for Chinese, because only Cambridge English-Chinese (Simplified/Traditional) Dictionary translates the Cambridge Dictionary literally. Since writing different parsers for multiple language dictionaries is a huge task, I will postpone it until there are many requests for this feature.
Thanks a lot for your suggestion.