Oxford Paravia English-Italian-English

I thought it was better to create a MDX version of oxford paravia english-italian, since there’s no MDX of that dictionary, so I created that.
29/2/20: first release
OxfordParavia.zip (17,7 MB)
29/3/20:

  1. merged two parts into one mdx file (thanks to @hua)
  2. included a css and an empty js in the mdx (thanks to @hua)
  3. now it’s more human-readable, adding orange color to the phrase to be translated, thanks to css (thanks to @kwomnk)
  4. removed padding between a phrase and another one, as it took up too much space and it made longer the entry definition
  5. added blue color in css, for meaning and green for alternative forms of entries below the entry
6 个赞

thanks for your work!
seems that you like separate mdx files haha.
image

Yes, because they were separate ebooks and I had to convert them separately to MDX :joy:

Hello @hua . I and @kwomnk tried several times to include these CSS on both IT-EN and EN-IT parts, but they didn’t work on GoldenDict, but they did on Eudic, beacuse it can recognise the CSS according to the MDX filename.
Could you try to include them? Thanks
OPCSS.7z (449 Byte)

@hua 为了给这个词典加点颜色,用欧陆时, 我把其他词典的css改成这个词典的名字,后来就出颜色了。

但我把改名的css 转发给作者后,因为他用的是GoldenDict,不知怎的就是不出颜色!

I will check this issue tonight.

Okay. Thank you so much! This issue has been driving us crazy!

Done and enjoy!

Oxford Paravia English-Italian Italian-English Dictionary.7z (20.1 MB)

Okay, let me explain how my fix works. MDX in nature is a collection of HTML files and in HTML files you will need to declare which css or js file you are going to use.
The issue with your file is, HTML codes don’t come with declarations, so goldendict does not know which css or js file it uses for the dict. I add declarations to the content of each entry, so problem solved. By the way, I have combined the two dicts. If you like separate files, you can do it following the method and screenshot I provide here. I also make a combined cover the two dicts, haha.
As for eudic, I guess it will automatically recognise and apply the css file with the same file name as MDX files.


I put my python code for processing here, which is easy to understand, for those who may need.

read1 = open('done.txt', 'r', encoding="utf8").readlines()

write1 = open('done_add.txt', 'w', encoding="utf8")
js_css = """<link rel="stylesheet" href="oxford_paravia_en22ita.css" type="text/css" ><script type="text/javascript" src="oxford_paravia_en22ita.js"></script>"""
for line in read1:
    if '<div>' in line:
        line = js_css + line
    write1.write(line)

write1.close()

你大概想到了是这个 css 没有被引用的原因吧?

1 个赞

Wow! Thank you! That’s much better than I did! Next time I want to include a css in a mdx, I’ll use that python code! :slight_smile:
Could you please explain how you combined two mdx/mdd files?

extract two mdx files get txt files, then copy and paste these two txt files into one txt file. finally convert txt to mdx

1 个赞

Thank you so much for the explanation. If I understand correctly, when creating a mdx, however the entries are sorted, the mdxeditor sorts alphabetically, so it’s not a problem when two dictionaries in txt format are merged into a one txt.

basically you are right. :grinning:

1 个赞