Q:

How to make the term "page" show in the Glossary list?

I have recently started to use the package glossaries.
When I make the Glossary list, the page numbers show up at the end of the description. So far so good.
I have found information about how to not show the page numbers.
I have found one solution in How to add the word "page" or "pages" in the Glossary how to add the words "page" or "pages". But it had some issues:

The previously existing cross-references disappeared. It used to look like
.
So my question is, can you include the words "page" or "pages" without losing the clickable cross-references?
Another problem with the found solution is that it tends to repeat the term "page" 
 
instead of just using it once.

The second issue seems to be solved
 
in the proposed solution of Problem with inserting "page" in Glossary, but I was not sure how to implement the proposed solution. At least I got error codes when trying to add the
% Columns in acronym table
\newglossarystyle{mylong}{%
  \setglossarystyle{long}%
  \renewenvironment{theglossary}%
     {\begin{longtable}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{0.8\hsize}}}%
     {\end{longtable}}%
      \renewcommand{\glossentry}[2]{%
      \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
      \glossentrydesc{##1}\glspostdescription\space 
      \pagesfalse
      \usepagestag{##1}\space
      ##2%
      \ifpages
        \savepagestag{##1}{pages}%
      \else
        \savepagestag{##1}{page}%
      \fi
      \tabularnewline
     }%
 }

code block from Problem with inserting "page" in Glossary to my .tex document.
Can anyone help me out with this?
/Lars

A:

The simplest method is to use the extension package glossaries-extra which provides \GlsXtrEnablePreLocationTag.
\documentclass{article}

\usepackage[colorlinks]{hyperref}
\usepackage[postdot]{glossaries-extra}

\makeglossaries

\GlsXtrEnablePreLocationTag{Page: }{Pages: }

\newglossaryentry{sample1}{name={sample1},description={first example}}
\newglossaryentry{sample2}{name={sample2},description={second example}}

\begin{document}
\gls{sample1}, \gls{sample2}.

\newpage

\gls{sample2}.

\newpage

\printglossaries

\end{document}

The build process is latex, makeglossaries, latex, latex (replace latex with pdflatex, xelatex or lualatex as appropriate).

