Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL: support abbreviations #426

Open
Foxtrod89 opened this issue Feb 9, 2023 · 2 comments
Open

DSL: support abbreviations #426

Foxtrod89 opened this issue Feb 9, 2023 · 2 comments
Labels

Comments

@Foxtrod89
Copy link

Is your feature request related to a problem? Please describe.
As you probably heard DSL supports abbreviation dictionary to display full description of abbreviation.

Describe the solution you'd like
Apple's Leopard Dictionary supports it as well.

Provide links and sample file(s)
dsl's tag for abbreviations [p], [/p] – labels (clicking a label displays its full text)

dsl file content
#NAME "Longman DOCE 5 (En-En) Abbrevs"
#INDEX_LANGUAGE "English"
#CONTENTS_LANGUAGE "English"

pl
plural

n
noun

C
countable

adj.
adj
adjective

adv.
adverb

conj.
conjunction

def.art.
definite article

@soshial
Copy link
Contributor

soshial commented Jun 1, 2023

Almost every dictionary has abbreviations and usually those are viewable as tooltips on hover? Is this information convertable between different formats?

Here's a demonstration of abbreviation tooltip in ABBYY Lingvo:
image

This might be implemented with CSS :hover attribute.
DSL File with abbreviations is usually included: https://github.com/Tvangeste/SampleDSL/blob/c910f190cd1da80158f717c5df9200c8388fd30c/sample_abrv.dsl

@ilius ilius changed the title DSL's abbreviation request DSL: support abbreviations Jun 27, 2023
@ilius ilius added the Feature label Jun 27, 2023
@soshial
Copy link
Contributor

soshial commented Nov 4, 2023

Found another example in a StarDict glossary:

Screenshot 2023-11-04 at 11 36 45 Screenshot 2023-11-04 at 11 38 07

The function seto() looked like this:

function seto(o, show) {
    var s = o.getElementsByTagName("small")[0];
    if (show === false) {
        s.style.display = 'none';
        return false;
    }
    if (s.offsetWidth > 200) {
        if ((o.offsetLeft + 200) > document.body.offsetWidth) {
            s.style.left = o.offsetLeft - ((o.offsetLeft + 200) - document.body.offsetWidth) + 'px';
        } else {
            s.style.left = o.offsetLeft + 'px';
        }
    } else {
        if ((o.offsetLeft + s.offsetWidth) > document.body.offsetWidth) {
            s.style.left = o.offsetLeft - ((o.offsetLeft + s.offsetWidth) - document.body.offsetWidth) + 'px';
        } else {
            s.style.left = o.offsetLeft + 'px';
        }
    }
    s.style.display = 'block';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants