cambridge icon indicating copy to clipboard operation
cambridge copied to clipboard

add other languages for translation

Open micronull opened this issue 2 years ago • 2 comments

You can make it as an option, which will be substituted in the url of the address.

micronull avatar Dec 22 '22 05:12 micronull

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.

mhwgoo avatar Dec 22 '22 12:12 mhwgoo

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.

mhwgoo avatar Mar 03 '23 10:03 mhwgoo