# How to put translations in parentheses on first use with glossaries-extra?

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):

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


With style:

\setabbreviationstyle[translation]{short-long}
\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.

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

\documentclass{book}
\usepackage{glossaries}

\newcommand{\glsEngInSwedish}[1]{%
\ifglsused{#1}%
{\gls{#1}}
{\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
\glssetnoexpandfield{english}

\newglossary*{trans}{Translations}
\newglossaryentry{test}
{
type=trans,
name={swedish word},
english={english translation},
description={testDesc},
}

\begin{document}
First use of \glsEngInSwedish{test} as well as second use of \glsEngInSwedish{test}
\end{document}