Next Previous Contents

6. qwordtrans / kwordtrans

There are two version for X-Window: qwordtrans and kwordtrans. Both are almost equal so I talk about them in the same section.

qwordtrans is the Qt version. The sources can be compiled with Qt 2.x.x (tested with Qt 2.0.2, 2.2.2 and 2.2.3).

kwordtrans is the KDE version. There are not much differences with qwordtrans, the most important is that it will have the same look as the other KDE applications. The most important difference is that it could be docked in the KDE panel.

6.1 Parameters

qwordtrans and kwordtrans are the versions for X-Window.

Usage

qwordtrans [--help] [--conf dir] [--nogui] [Qt-options]

kwordtrans [--help] [--conf dir] [--nogui] [Qt-options] [KDE-options]

Wordtrans options:

--help

Shows a helping message.

--conf dir

Directory with the configuration files. This is used in the web interface to read the configuration files from the directory /etc/wordtrans, so wordtrans can be executed as the user nobody.

--nogui

Behaves like the console application "wordtrans". Example: 'qwordtrans --nogui -d i2e car' is the same as 'wordtrans -d i2e car'

Qt-options. All Qt programs support the following parameters (from qt-doc):

-style= style

sets the application GUI style. Possible values are motif, windows, and platinum.

-session= session

restores the application from an earlier session.

-display display

sets the X display (default is $DISPLAY).

-geometry geometry

sets the client geometry of the main widget.

-fn or -font font

defines the application font.

-bg or -background color

sets the default background color and an application palette (light and dark shades are calculated).

-fg or -foreground color

sets the default foreground color.

-btn or -button color

sets the default button color.

-name name

sets the application name.

-title title

sets the application title (caption).

-visual TrueColor

forces the application to use a TrueColor visual on an 8-bit display.

-ncols count

limits the number of colors allocated in the color cube on a 8-bit display, if the application is using the QApplication::ManyColor color specification. If count is 216 then a 6x6x6 color cube is used (ie. 6 levels of red, 6 of green, and 6 of blue); for other values, a cube approximately proportional to a 2x3x1 cube is used.

-cmap

causes the application to install a private color map on an 8-bit display.

KDE-options:

--help-qt

Show Qt specific options.

--help-kde

Show KDE specific options.

--help-all

Show all options.

--author

Show author information.

-v, --version

Show version information.

--license

Show license information.

6.2 How to use it

Using this application is very simple. Basically you type the word to look for and qwordtrans will search it and display the matches found in the selected dictionary.

Application window

The application has the following items (up to down):

Menus

Tool bar

qwordtrans has some icons in the tool bar, if you stop the mouse over them for a while a tooltip will show telling you what's that button for:

Input text box

In this box you can type the word to look for. Pressing enter (or clicking in the button on the right) the search will be performed.

Output window

Here is where the words matched will be displayed. If the application is compiled with Qt 2 the search term will be in bold, improving the legibility.

The right way of adding new translations

(From the i2e man page)

When adding words to the dictionary (button "Learn") it should be taken into account that when a word allows several different translations, they should be learned separately.

For example, 'hola' can be translated as 'hi' or as 'hello', so, in order to add 'hola' to the dictionary with both translations, 'hola' and 'hi' should be learnt first and then 'hola' and 'hello'.

6.3 Creating or adding a dictionary

The most of the times I talk about "dictionary" I'm referring to the group of data (files, icons, language's names, etc.) that wordtrans needs to be able to use a determined dictionary, but not to the dictionary itself (the list of words with the equivalences for one and another language).

New dictionary

With this option you can configure qwordtrans to support a new dictionary. When selecting this option qwordtrans will create the necessary structure to manage a new dictionary (with some data by default). Once this is done it will show you the dictionary editing dialog.

Dictionary editing dialog

When you edit or create a dictionary you'll see this dialog with some fields you should fill:

Main

alias

The alias is used by the console version (binary wordtrans), to choose the dictionary to use. It's also used as the configuration file name in new dictionaries. The name will be ~/.wordtrans/typed_alias.conf. Once this file has been created the file name won't be changed although you change the alias.

dictionary

Here you have to type the path where the main dictionary is. You can click on the right button to select it from the file dialog.

personal

Here goes the file used as your personal dictionary, in other words, where the new translations will be added. This file will be stored in your HOME directory. Don't put an absolute file name!

language 1

Name of the first language of the dictionary.

language 2

Name of the second language of the dictionary.

separator

Separator used by the dictionary to separate the words in a language of the another one. i2e dictionary uses " : " (without quotations marks), in other words, space, colon, space; while trans-de-en dictionary uses " :: ".

icon 1

Here goes the icon that represents "translation of language 1 into language 2". In directory /usr/share/icons/wordtrans/ you have some icons. You can make new ones with the gimp, for example. I recommend that icons aren't bigger than 26x26 pixels.

icon 2

Here goes the icon that represents "translation of language 1 into language 2".

NOTE: If you're editing a dict server dictionary this dialog will be quite different. In section dict there's an explanation of that dialog.

Description

You can type here a description for the dictionary. You can indicate copyright info, where you download it from, or whatever you want.

You may also use some HTML-like tags, but lookout it is not HTML. If you want to know exactly what tags you can use type man qstylesheet (you'll need the Qt 2 development library installed to work).


Next Previous Contents