Thursday, October 10, 2013

Convert Babylon BLG to Stardict IFO dictionaries


ColorDict Dictionary Wikipedia - screenshot thumbnail



If you use the excellent ColorDict for Android, which is capable of modal windows (unlike, say GoldenDict, which in turn can read many dictionary formats), then you may be in need for more dictionaries than Google allows.

Here's how to quickly convert Babylon BLG dictionary files to the Stardict, aka IFO, aka ColorDict format in Windows.
  • Download a BLG dictionary file itself, from the Babylon site, or e.g. from a torrent here. (We will use Spanish-English Dictionary (Granada University, Spain), 13.5 dictionary file below, saved to C:\Temp\Babylon stardict files\)
  • Download and install Python 2.* to C:\Program Files\Python27\ (Important: Python 3.* is not compatible with the script, as of yet)
  • Download PyGlossary 2011 from the PyGlossary site to e.g. C:\Temp\Babylon stardict files\pyglossary-2011.06.16\. (Important: the older versions seem not do not produce Stardict compatible files)
  • Here's the trick. Do not run its otherwise nice GUI. Run a DOS command instead:
    "C:\Program Files\Python27\python.exe" "C:\Temp\Babylon stardict files\pyglossary-2011.06.16\src\pyglossary.pyw" "C:\Temp\Babylon stardict files\A Spanish-English Dictionary (Granada University, Spain).BGL" "C:\Temp\Babylon stardict files\A Spanish-English Dictionary (Granada University, Spain).ifo"
  •  You should see:
    Reading file "C:\Temp\Babylon stardict files\A Spanish-English Dictionary (Granada University, Spain).BGL"
    numEntries = 80289
    defaultCharset = cp1252
    sourceCharset = cp1252
    targetCharset = cp1252
    defaultEncoding = cp1252
    sourceEncoding = cp1252
    targetEncoding = cp1252
    sourceLang = Spanish
    targetLang = English
    creationTime = 2006/12/12, 09:22
    middleUpdated = 2010/02/23, 07:54
    lastUpdated = 2010/02/23, 07:54
    title = A Spanish-English Dictionary (Granada University, Spain), 10.2
    author = Tony
    email = alozano@ugr.es
    copyright =
    description = This is a compilation of terminology in the social sciences that students and professionals generally encounter when reading professional literature with a particular emphasis on information organisation and retrieval. Last update February 2010. (http://eubd1.ugr.es)
    Loading: |Ôľł                                               /  2.5% ETA: 00:00:3
    Loading: |ÔľłÔľł                                              -  5.0% ETA: 00:02
    Loading: |ÔľłÔľłÔľł                                             \  7.5% ETA: 00:
    Loading: |ÔľłÔľłÔľłÔľł                                            | 10.0% ETA: 0
    Loading: |ÔľłÔľłÔľłÔľłÔľł                                           / 12.5% ETA:
    Loading: |ÔľłÔľłÔľłÔľłÔľłÔľłÔľł                                         - 14.9%
     etc.

    • Be patient! The script seems to get stuck on:
    Writing to file "c:\temp\A Spanish-English Dictionary (Granada University, Spain).ifo"
    filename=c:\temp\A Spanish-English Dictionary (Granada University, Spain).ifo
    but after about a dozen of minutes it terminates with:
    Done
    and returns to the command prompt.
    You should get:
    Copy these to the \sdcard\dictdata directory on your Android and run ColorDict.

17 comments:

  1. Thank you very much for this. It really helped me a lot. I was able to easily convert my babylon dictionaries to stardict format to use with zo reader which is the best ebook reader I have found for language learners. The dictionary word-lookup is nearly instantaneous.

    ReplyDelete
  2. I'm happy it helped somebody. FYI. I usually use these dictionaries on my Android whitepaper ebook reader (Tolino).

    ReplyDelete
  3. Thank you for this trick, I really like it.

    Now, I've got about 100 dictionaries on my Android device, thank you so much.


    ColorDict works with Moon Reader, and thus I'm able to translate any word I come across while reading references.

    ReplyDelete
    Replies
    1. Dude, 100 dictionaries? Please, tell me if you use Soulseek or something like that. I'd kill for those files.

      Delete
  4. Great :) It's working with babylon extension ".BGL" :)

    How can I convert babylon extension ".bdc" ? .. using this trick, I just got :

    Unknown extension ".bdc" for read support!
    reading input file was failed!

    :(

    ReplyDelete
    Replies
    1. Maybe you can find BGL version of that dictionary. When a BGL file installed on Babylon v10 it converts it to a BDC file which can be found under the folder of C:\ProgramData\Babylon\Gloss.

      Delete
  5. Cool. I managed to convert English to Indonesia file. Works smoothly on ColorDict! I need to do this because stardict files that I found online can't be indexed by ColorDict.

    Such a great help. Thanks anyway!

    ReplyDelete
  6. hello and great trick.
    now i have a prolem with a large bgl file (>200MB), it gets memory error or something and can't read to the end of bgl file
    can i encrease load memory?

    ReplyDelete
  7. Sorry, Huy, I do not know how to help.

    I can only advise closing all the other programs or increasing the size of the swap file.

    ReplyDelete
  8. Thanks for fast reply
    I did try to convert an Urban Dictionary with 1017849 entries
    Maybe I have to dig deeper into python code

    ReplyDelete
  9. Can I convert Stardict IFO dictionaries to babylon bgl

    ReplyDelete
  10. thanks
    how to convert blg to lingoes dict ?

    ReplyDelete

Note: Only a member of this blog may post a comment.