Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read preferences from GoldenDict config file #6

Open
dohliam opened this issue Feb 28, 2015 · 0 comments
Open

Read preferences from GoldenDict config file #6

dohliam opened this issue Feb 28, 2015 · 0 comments

Comments

@dohliam
Copy link
Owner

dohliam commented Feb 28, 2015

Currently gdcl uses gdcg.rb to prepare custom groups of dictionaries for searching. Ideally, gdcl should look in the GoldenDict home folder and read the preferences in the GoldenDict config file so that we can use groups that have already been set up by the user.

The config file is relatively simple and the groups are arranged under <group> tags, e.g.:

  <group id="1" name="zh">

followed by a list of dictionaries between dictionary tags, e.g.:

   <dictionary name="Chinese Wikipedia">935a97e41606b54a232c18374b15754b</dictionary>

The only problem is that, as seen in the example above, the dictionaries are listed by their index hash rather than file name or location. So to get the file location we need to first read the preferences folder to discover the group name, and then get the location and other information from the index file.

Unfortunately, the index file is encoded, so we need to decode the file to read the location information. It is not immediately obvious how to do that, but someone more familiar with the GoldenDict source code might be able to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant