Dictionary Universal for iPhone and iPad


Compressed Data

There are different types of data composing a dictionary, such as text and images. Dictionary Universal allows you to take advantage of compression to save disk space on your mobile device.

The following data can be compressed:

  • Dictionary text. Use dictzip utility on your computer to compress dict file to dict.dz format, if your dictionary has not been compressed yet.
  • Dictionary resources (new in 3.0). These resources (such as images) are stored in res folder. Just compress this folder to a zip archive named res.zip and replace res folder with the resulting archive. Although in some cases the archive size could be close to the total size of all resource file, you'll still gain benefits of using a single large file instead of thousands of small files. Here's why. Each file stored on disk occupies a number of storage blocks, depending on file size. iPhone allocates 4Kb (4096 bytes) per block, so even a small file storing just a single word, will actually take 4Kb on iPhone. Thus on average each file takes about 2Kb extra on disk, whereas there can be thousands of resource files in StarDict dictionary, wasting megabytes of valuable disk space.


Pronunciation

Dictionary Universal 3.0 allows users to hear how words are pronounced. This requires appropriate pronunciation bundles installed.

Pronunciation bundle is a set of sound files with recorded human voice compressed in a single archive. This archive should be created taking the following simple rules into consideration:

  • Pronunciation bundle archive format must be either zip (recommended), tar, tar.bz2* or tar.gz*. Make sure file names are stored in archive in UTF-8 encoding. Advanced technology implemented in Dictionary Universal allows quick access to individual files in these archives without extracting the whole archive. So, instead of having thousands of small files on disk, Dictionary Universal will work with single file, thus saving disk space on your device.

    * - will be automatically extracted to tar file during installation.

  • Sound files inside the archive must be either in mp3 or wav format. mp3 format is recommended since it requires less disk space than wav format. Single archive may contain a mixture of mp3 and wav files. Any other files are ignored by the application. If you are creating a custom pronunciation bundle, make sure you remove any other files to save disk space on device.
  • Sound file name must match a word from the dictionary. For example, a sound file for keyword "test" must be named either test.mp3 or test.wav depending on the sound format. Dictionary Universal does not impose any limitations on folder structure inside the archive - sound file will be quickly found wherever it is located in the archive. However there's a common practice of creating a separate folder for each alphabet letter and placing sound files accordingly. For example, sound file dictionary.mp3 could be placed in a folder named d.

Currently available StarDict pronunciation bundles are already compatible with these rules, so they can be used with no changes.


3rd party apps integration

Dictionary Universal can be integrated with 3rd party apps for displaying articles*. For example, a book reader application may provide possibility of using external dictionaries.

Dictionary Universal can be invoked using one of the URLs:

  • dictionary:term
    (all versions)
  • dictionary://x-callback-url/lookup?term=term
    or
    dictionary://x-callback-url/lookup?term=term&x-success=URL
    (starting from version 5.0)
    For more information on x-callback-url please visit x-callback-url.com.

* - 3rd party app must implement this functionality accordingly.


User styles and scripts

Version 7.0 has ability to use user styles (CSS) and scripts (Javascript) for customizing articles appearance. This ability can also be used by dictionary authors.

Global styles and scripts are applied to all installed dictionaries. Global style file should be named user.css and placed in app's documents via iTunes. User script should be named user.js and is installed similary.

Dictionary style and script applies to a single dictionary. In this case files should be named according to dictionary files names.

For example, to change article's background color the user.css file with the following contents can be used:

	body {
		background-color: #F8F8F8;
	}
		

Copyright © 2010-2015 Dmitry Zhuk. All rights reserved.