X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBiblioInfo.cpp;h=80cafeb3595bf1a60b005084f43bf5c2bf295ac2;hb=1e519d1115f41f71c253cb9e2fbb7803e9a583a9;hp=86fd8401b492e85b09e6d5078186ff96b534f87a;hpb=eebea6284d521c1a291de3b3ed483969f882dcd7;p=lyx.git diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index 86fd8401b4..80cafeb359 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -524,6 +524,12 @@ docstring const BibTeXInfo::getAuthorList(Buffer const * buf, // in this case, we didn't find a "(", // so we don't have author (year) return docstring(); + if (full) { + // Natbib syntax is "Jones et al.(1990)Jones, Baker, and Williams" + docstring const fullauthors = trim(rsplit(remainder, ')')); + if (!fullauthors.empty()) + return fullauthors; + } return authors; } @@ -541,16 +547,16 @@ docstring const BibTeXInfo::getAuthorList(Buffer const * buf, // These are defined in the styles string const etal = - buf ? buf->params().documentClass().getCiteMacro(engine_type, "_etal") + buf ? buf->params().documentClass().getCiteMacro(engine_type, "B_etal") : " et al."; string const namesep = - buf ? buf->params().documentClass().getCiteMacro(engine_type, "_namesep") + buf ? buf->params().documentClass().getCiteMacro(engine_type, "B_namesep") : ", "; string const lastnamesep = - buf ? buf->params().documentClass().getCiteMacro(engine_type, "_lastnamesep") + buf ? buf->params().documentClass().getCiteMacro(engine_type, "B_lastnamesep") : ", and "; string const pairnamesep = - buf ? buf->params().documentClass().getCiteMacro(engine_type, "_pairnamesep") + buf ? buf->params().documentClass().getCiteMacro(engine_type, "B_pairnamesep") : " and "; string firstnameform = buf ? buf->params().documentClass().getCiteMacro(engine_type, "!firstnameform") @@ -811,13 +817,20 @@ docstring BibTeXInfo::expandFormat(docstring const & format, fmt = from_utf8(val) + fmt.substr(1); counter += 1; continue; - } else if (key[0] == '_') { - // a translatable bit + } else if (prefixIs(key, "B_")) { + // a translatable bit (to the Buffer language) string const val = buf.params().documentClass().getCiteMacro(engine_type, key); docstring const trans = translateIfPossible(from_utf8(val), buf.params().language->code()); ret << trans; + } else if (key[0] == '_') { + // a translatable bit (to the GUI language) + string const val = + buf.params().documentClass().getCiteMacro(engine_type, key); + docstring const trans = + translateIfPossible(from_utf8(val)); + ret << trans; } else { docstring const val = getValueForKey(key, buf, ci, xrefs, max_keysize);