I am currently writing a thesis in Swedish and have chosen to use Swedish translations for certain terms. Since they are not well known in Swedish, I would like to present the English term in parentheses on first use:

... kontinuerlig integration (eng. continuous integration) ...

Subsequent use:

... kontinuerlig integration ...

This is different from the style in this answer that uses glossaries-extra with the long-short-user style because I want no short (acronym) and I want the long (Swedish term) to be output in subsequent usages. A style like user-long, if that existed.


My current solution, a workaround of sorts, is formatting entries like this (with bib2gls):

    name = {kontinuerlig integration},
    description = {Eng. \emph{continuous integration}, ...},
    long = {continuous integration},
    category = {translation}

With style:

\renewcommand*{\glsfirstlongdefaultfont}[1]{eng. \emph{#1}}

This results in the desired formatting, but seems wrong. According to section 3.4.2 of the manual the style doesn't set the regular attribute which, according to chapter 5, indicates that it is an abbreviation. I wouldn't say that it is.

Also, this requires setting the translation as long. I would say that the English term is something else, maybe user.

So this solution seems wrong. I would appreciate any less hacky solution.

| improve this answer | |

If you want to stick to glossaries/glossaries-extra, try the code below. I recommend an extra glossary (here defined as 'trans') so its entries will only show up where you use \printglossary[type=trans].

Update #1: i overlooked the 'only on first use' demand

Update #2: sigh ... i missed the replacement of the sample text & figure


    {\gls{#1} (engl. \glsentryEnglish{#1})}%
    \glsunset{#1}% ensure flag for use

{english}           % key
{\glsentrytext{todo}}   % default value
{\glsentryEnglish}  % command analogous to \glsentrytext
{\GlsentryEnglish}  % command analogous to \Glsentrytext
{\glsEnglish}       % command analogous to \glstext
{\GlsEnglish}       % command analogous to \Glstext
{\GLSEnglish}       % command analogous to \GLStext

    name={swedish word},
    english={english translation},

    First use of \glsEngInSwedish{test} as well as second use of \glsEngInSwedish{test}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.