FAQ

From GoldenDict Wiki

Revision as of 06:49, 17 November 2010 by Det (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here we collect popular questions with answers, various tips and stuff like that. Please don't hesitate to add material here!

Contents

Where do I get a portable version of the program?

As of May 28, 2010, portable mode is supported by the main version of the program. You just need to create a directory named "portable" in the program's directory. This directory will then be used to store configuration and indices. Your dictionaries should be stored in the "content" directory, and morphologies in the "content/morphologies" directory. Sound directories aren't supported in portable mode.

Use a recent enough Git build to have this functionality.

How do I change the font used for the articles? Or alter its appearance in any other way?

The article text you see is actually an HTML page. It has its own CSS style which can be arbitrarily altered. To do so, you need to create a special text file article-style.css, located in Linux in ~/.goldendict, and in Windows in %APPDATA%\GoldenDict. You can put arbitrary CSS code there. Example:

body
{
  background: blue;
  font-family: Verdana;
  font-size: 16px;
}

This would change the background color of the whole page to blue, and use font Verdana, 16 pixels large. To see which attributes are available, see this file, which defines all the initial default values.

Another handy way to find the needed attributes is to save an article you would like to customize to HTML using File|Save Article, and then use Firefox with the FireBug extension or another similar tool to explore the existing attributes.

How do I change fonts for only a specific language?

Some scripts or languages (e.g. Hindi, Urdu, Bengali) are not rendered well with the default system fonts. You can specify the fonts GoldenDict uses for these languages by customizing two CSS style sheets: article-style.css (see the previous question) for changes to the main article display pane, and qt-style.css for changes to the search box and word list.

Article fonts are specified using the standard lang(xx) CSS pseudo-class, and also the special gdlangfrom-xx CSS class, where xx is an ISO 639-1 two-letter language code. The following examples can guide you in editing your article-style.css:

:lang(ru)
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

This will apply to all articles containing translations to the Russian language. Now,

.gdlangfrom-ru
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

will apply to all articles containing translations from the Russian language. You can also specify both:

.gdlangfrom-en:lang(ru)
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

This will only apply to the articles translating from English to Russian. And here's how to match the either one:

:lang(ru), .gdlangfrom-ru
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

This will match articles translating either from Russian, or to Russian.

Note that this feature is only available in the recent enough GIT version (one from April 3, 2010 or later).

Search box and wordlist fonts are specified in qt-style.css (located in the same directory as article-style.css) using the currentGroup property, which corresponds to defined dictionary groups. For example, you can change the font used for searches in a Bengali dictionary group by adding the following to your qt-style.css:

MainWindow #searchPane #translateLine[currentGroup="Bengali"], MainWindow #searchPane #wordList[currentGroup="Bengali"]
{
  background: white;
  color: black;
  font-family: "SolaimanLipi";
  font-size: 20px;
}

Note that this feature is only available in the recent enough GIT version (one from Nov 16, 2010 or later).

Personal tools