Page 1 of 2

Specifying language in .dsl dictionaries

PostPosted: Mon Sep 27, 2010 11:15 am
by det
I'm having trouble getting language-specific fonts to display in my Bengali-English dictionary (using article-style.css as in http://goldendict.org/wiki/index.php/FAQ), and I wonder if I am specifying the language correctly.

With the following dsl dictionary header, GD seems to pick up the languages correctly (the Bangladesh flag is displayed in the dictionary list).

Code: Select all
#NAME "Bengali-English Dictionary (v 0.4) [bn-en]"
#INDEX_LANGUAGE "Bengali"
#CONTENTS_LANGUAGE "English"

But then what do I need to ensure that headwords and other Bengali text is recognized? If all English is enclosed in [trn]...[/trn], is that enough -- is all text outside the [trn] tags assumed to be Bengali? Or do I also need to use the [lang] tags around the Bengali? If so, where can I look up the language ID ([lang id=xxxxx])?

(Using GD 0.9.0+git on linux - Ubuntu 10.04; also tried this on Windows Vista)

Re: Specifying language in .dsl dictionaries

PostPosted: Sat Nov 13, 2010 3:33 pm
by det
After reinstalling with Ubuntu 10.10, the language-specific font shows in the main dictionary result pane. But the search bar and the list words below it are not in the specified font. Is there anything I can do to get those to also display in my desired Bengali font?

Re: Specifying language in .dsl dictionaries

PostPosted: Sat Nov 13, 2010 4:59 pm
by ikm
Yes, you can create qt-style.css file in your ~/.goldendict and adjust settings there. See qt-style.css in the goldendict source code tree to get a clue on how the default one looks like.

Re: Specifying language in .dsl dictionaries

PostPosted: Mon Nov 15, 2010 9:25 am
by det
Thank you! Adding the font properties to the first section of qt-style.css got my desired font in the search bar and wordlist:

Code: Select all
MainWindow #searchPane #translateLine, MainWindow #searchPane #wordList
{
  background: white;
  color: black;
  font-family: "SolaimanLipi";
  font-size: 20px;
}

But it would be preferable if this font was just used for Bangla, and the default one was used for English. How would I add that conditional?

Also, for the article rendering: is it currently possible to use different fonts for different languages in the same article? At the moment with following edits to article-style.css (described in the Wiki), font changes are applied to the whole article, not to a specific language within the article.

Code: Select all
:lang(bn), .gdlangfrom-bn
{
  font-family: "SolaimanLipi";
  font-size: 20px;
}

Re: Specifying language in .dsl dictionaries

PostPosted: Mon Nov 15, 2010 3:27 pm
by ikm
Ok, I've just added this feature. Using the latest Git, do like this:

Code: Select all
MainWindow #searchPane #translateLine[currentGroup="En"], MainWindow #searchPane #wordList[currentGroup="En"]
{
  background: white;
  color: black;
  font-size: 20px;
}

Would you mind describing this new piece of functionality at Wiki FAQ?

Re: Specifying language in .dsl dictionaries

PostPosted: Tue Nov 16, 2010 10:39 am
by det
I couldn't get this working. I copied your code, just replacing "En" with my group names (trying both 'English' and 'Bengali', as well as the 2-letter language codes). Changes showed up when the [currentGroup="En"] property was left out, but not when it is included. Anything else I can try, or any debugging suggestions?

Re: Specifying language in .dsl dictionaries

PostPosted: Tue Nov 16, 2010 9:03 pm
by ikm
Are you sure you were using the very latest Git?

Re: Specifying language in .dsl dictionaries

PostPosted: Wed Nov 17, 2010 6:54 am
by det
ok - I had built the latest git, but had not done 'make install' so was actually using the old one...whoops. Now it's working fine, and I have edited the wiki FAQ page. The one thing that is missing there is a note on where to get the qt-style.css from initially. I don't remember exactly now, but I don't think it was in my home directory to start with...

Re: Specifying language in .dsl dictionaries

PostPosted: Wed Jan 12, 2011 11:07 am
by rezwansaki
Please, can anyone give me a English-Bengali dictionary database file for 'GoldenDict' ?
Please, help me.

Re: Specifying language in .dsl dictionaries

PostPosted: Thu Jan 13, 2011 8:33 am
by det
rezwansaki - I'm afraid I don't yet have anything with a public license that I can give out... but perhaps I will later. If you get hold of anything, please let me know.