Bibliographies Languages – How to Fix Wrong Language in Bibliography

bibliographieslanguages

Despite the document being in Italian, the online entries of the bibliography are in English (Available on: http://whatever.com [Accessed on: 2002 Jan 8] instead of : Disponibile su: http:whatever.com [Consultato 8 Gen 2022]

I do not understand why the language preference is not passed to this item.
Is there a way to fix it or, at least, redefine the labels?

This is a MWE

\documentclass[chapterprefix=true]{scrbook}
\setcounter{secnumdepth}{0}

\usepackage[table]{xcolor}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{textcomp}
\usepackage{indentfirst}
\usepackage{times}
\usepackage{mathptmx}
\usepackage{setspace}
\usepackage{tikz}%per la flowchart
\usetikzlibrary{positioning,chains}
\doublespacing
\usepackage{caption}  %per aggiungere captions al PRISMA ed evitare il floating delle tavole
\usepackage{booktabs} % For prettier tables

\usepackage[style=vancouver,citestyle=numeric-comp,sorting=none,isbn=false,url=false,eprint=false, doi=false]{biblatex}
\doublespacing

\makeatother
\defbibheading{bibliography}[\bibname]{%
    \subsection*{#1}%ridefinisce l'heading della bibliografia come subsection
    \addxcontentsline{toc}{subsection}{#1}}%lo aggiunge alla TOC

\addbibresource{LGBiBiblio.bib}
\renewbibmacro*{url+urldate}{}


\begin{document}
    \author{}
    
    \subject{Linea Guida}
    \title{\textbf{Il trattamento laparoscopico di laparocele e ernie ventrali}}
    \subtitle{}
    \titlehead{}
    
    
    \date{Gennaio 2022}
    
    \frontmatter
    \maketitle
    \tableofcontents
    \chapter{Intro}
    
    This is a text citing a journal\cite{ahmed2011a}
    
    This is another text citing an @online source\cite{wells}
    
    \printbibliography
    
    
    
    \mainmatter
    \part{Sviluppo della linea guida}
    \chapter{one}
    
    \textbf{text}
    
    
text
    

\end{document}

and these are the entries of the MWE:

@online{wells,
  title = {The {{Newcastle-Ottawa Scale}} ({{NOS}}) for Assessing the Quality of Nonrandomised Studies in Meta-Analyses},
  author = {{Wells GB} and Shea, B and O'Connell, D and Peterson, J and Welch, V and Losos, M and Tugwell, P},
  url = {http://www.ohri.ca/programs/clinical_epidemiology/oxford.asp},
  urldate = {2022-01-08},
  file = {/home/fabio/Zotero/storage/WMUVSDY7/oxford.html}
}

@article{ahmed2011a,
  title = {A Simple Technique of Regional Anesthesia to Reduce Opioid Requirements Postoperatively in Laparoscopic Incisional Hernia Repairs},
  author = {Ahmed, M. and Alibhai, M. and Pattar, J. and Duffield, R. G.},
  date = {2011-04},
  journaltitle = {Surg Laparosc Endosc Percutan Tech},
  shortjournal = {Surgical laparoscopy, endoscopy \& percutaneous techniques},
  volume = {21},
  number = {2},
  pages = {e70-1},
  issn = {1530-4515},
  doi = {10.1097/SLE.0b013e31820afdad},
  abstract = {Laparoscopic incisional hernia repair can be associated with initial postoperative pain requiring opioids in the form of patient controlled analgesia (PCA). Our study demonstrates the use of an innovative form of intra-operative regional anaesthesia in the form of an abdominal extraperitoneal block (AEP) which reduced mean opioid consumption in our patients by 62\% without any intra-operative complications.},
  langid = {english},
  file = {/home/fabio/Zotero/storage/4GUS9968/Ahmed et al. - 2011 - A simple technique of regional anesthesia to reduc.pdf;/home/fabio/Zotero/storage/P8M8GJPW/Ahmed M_2011_SIGN.pdf}
}

Best Answer

The vancouver style you are using hard-codes the English text. This is not standard practice for biblatex styles, since biblatex provides a localisation/translation interface for strings.

I would not use biblatex-vancouver. Instead I would try to achieve the desired layout starting from one of the standard styles (or maybe from biblatex-ext).

Assuming you use vancouver because you want to follow Vancouver style (NLM's Citing Medicine, https://www.ncbi.nlm.nih.gov/books/NBK7256/) I would go for something like the following, which uses standard biblatex interfaces for strings (so that they are easy to translate).

\documentclass[chapterprefix=true]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}

\usepackage[
  style=ext-numeric-comp,
  sorting=none, 
  maxbibnames=99,
  giveninits=true,
  terseinits=true,
  isbn=false, url=false, eprint=false, doi=false,
  alldates=ymd,
  labeldate=year,
]{biblatex}

\makeatletter
\renewrobustcmd*{\bibdatesep}{\addspace}
\renewrobustcmd*{\blx@ymddate}[3][]{%
  \dateeraprintpre{#2#3year}%
  \mkyearzeros{\thefield{#2#3year}}\ifblank{#1}{}{\printfield{#1}}%
  \iffieldundef{#2#3month}{}{\bibdatesep\mkbibmonth{\thefield{#2#3month}}}%
  \iffieldundef{#2#3day}{}{\bibdatesep\mkdayzeros{\thefield{#2#3day}}}}
\makeatother

\DeclareNameAlias{default}{family-given}

\renewcommand*{\revsdnamepunct}{}

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{journaltitle}{#1}
\DeclareFieldFormat*{maintitle}{#1}
\DeclareFieldFormat*{booktitle}{#1}

\renewbibmacro*{in:}{}

\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewcommand*{\volnumdelim}{}

\DeclareFieldFormat{issuedate}{#1}

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addperiod\space}%
  \iffieldundef{series}
    {}
    {\setunit*{\jourserdelim}%
     \printfield{series}%
     \setunit{\addperiod\space}}%
  \usebibmacro{date}%
  \setunit{\addsemicolon}%
  \usebibmacro{volume+number+eid}%
  \newunit}

\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\addspace#1}}
\renewbibmacro*{date}{%
  \printdate
  \setunit{\addspace}%
  \ifboolexpr{
    togl {bbx:url}
    and not test {\iffieldundef{url}}}
    {\printurldate}
    {}}

\renewcommand*{\bibpagespunct}{%
  \ifentrytype{article}
    {\addcolon}
    {\addspace\semicolon}}
\DeclareFieldFormat[article]{pages}{#1}

\DeclareFieldFormat{url}{%
  \bibstring{urlfrom}%
  \addcolon\space
  \url{#1}}

\newbibmacro*{url+urldate}{%
  \usebibmacro{url}}

\renewcommand*{\finentrypunct}{}

\DefineBibliographyStrings{italian}{
  urlfrom = {disponibile su},
  urlseen = {consultado},
}

\begin{filecontents}{\jobname.bib}
@online{wells,
  title   = {The {Newcastle-Ottawa Scale} ({NOS})
             for Assessing the Quality of Nonrandomised Studies
             in Meta-Analyses},
  author  = {Wells, G. B. and Shea, B. and O'Connell, D.
             and Peterson, J. and Welch, V. and Losos, M.
             and Tugwell, P.},
  url     = {http://www.ohri.ca/programs/clinical_epidemiology/oxford.asp},
  urldate = {2022-01-08},
}
@article{ahmed2011a,
  title        = {A Simple Technique of Regional Anesthesia
                  to Reduce Opioid Requirements Postoperatively
                  in Laparoscopic Incisional Hernia Repairs},
  author       = {Ahmed, M. and Alibhai, M. and Pattar, J. and Duffield, R. G.},
  date         = {2011-04},
  journaltitle = {Surg Laparosc Endosc Percutan Tech},
  shortjournal = {Surgical Laparoscopy, Endoscopy \& Percutaneous Techniques},
  volume       = {21},
  number       = {2},
  pages        = {e70-1},
  issn         = {1530-4515},
  doi          = {10.1097/SLE.0b013e31820afdad},
  langid       = {english},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
  This is a text citing a journal\cite{ahmed2011a}
    
  This is another text citing an @online source\cite{wells}
    
  \printbibliography
\end{document}

Wells GB, Shea B, O’Connell D, Peterson J, Welch V, Losos M e Tugwell P. The Newcastle-Ottawa Scale (NOS) for Assessing the Quality of Nonrandomised Studies in Meta-Analyses [consultado 2022 gen. 08]. Disponibile su: http://www.ohri.ca/programs/clinical_epidemiology/oxford.asp

Related Question