New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

Hope goldendict could support separate css file

General discussion

Hope goldendict could support separate css file

Postby hanyl05 » Sun Feb 17, 2013 10:43 am

Hope goldendict could support separate css file for stardict dictionaries.
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

Re: Hope goldendict could support separate css file

Postby Tvangeste » Sun Feb 17, 2013 11:12 am

To be honest, I'm not that familiar with Stardict format. If some css file is listed in the dictionary itself, where is it located?

I mean, if somebody needs to adjust formatting for the specific dictionary then that particular dictionary needs to be updated. I'm sure there is a way to extract the contents from stardict dictionary and redo it with adjustments.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Hope goldendict could support separate css file

Postby hanyl05 » Sun Feb 17, 2013 1:22 pm

Thanks Tvangeste.
I want to express my question in another way as follows:
Is it possible to build a series of css files, named a.css, b.css, d.css,e.css...
and let specified css files support a specified dictionary, for example, a.css is used for Longman dictionary, and b.css is used for
another dictionary?

Thanks!
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

Re: Hope goldendict could support separate css file

Postby chulai » Sun Feb 17, 2013 2:35 pm

I just committed the change to support loading external CSS files in the same way you can load images. The css file has to be stored in the "res" subfolder located at the same level as the stardict dictionary files.

location of css files.PNG
CSS files must be located in the RES subfolder
location of css files.PNG (52.25 KiB) Viewed 7832 times



I only tested this with "Oxford English-Chinese dictionary", the only dictionary I have which contains a CSS file:

Before:
Oxford English-Chinese Stardict dictionary with no css external file handling.PNG
Oxford English-Chinese Stardict dictionary with no css external file handling
Oxford English-Chinese Stardict dictionary with no css external file handling.PNG (114.64 KiB) Viewed 7832 times


After:
Oxford English-Chinese Stardict dictionary with css external file handling.PNG
Oxford English-Chinese Stardict dictionary with css external file handling
Oxford English-Chinese Stardict dictionary with css external file handling.PNG (98.5 KiB) Viewed 7832 times


As you can see after the fix the CSS is loaded and the text is formatted correctly.

You can compile from source code or wait until next Developer or Early Access build.

Regards
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: Hope goldendict could support separate css file

Postby hanyl05 » Sun Feb 17, 2013 3:14 pm

Fantastic!!!
I am eagerly waiting for the coming early build.o(∩_∩)o
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

Re: Hope goldendict could support separate css file

Postby Tvangeste » Sun Feb 17, 2013 6:31 pm

hanyl05 wrote:Fantastic!!!
I am eagerly waiting for the coming early build.o(∩_∩)o

The dev build that includes this fix has been posted in the dev builds thread, so you can take a look.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am


Return to General

Who is online

Users browsing this forum: No registered users and 28 guests