X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FAuthor.cpp;h=3d03fe71131ada993ade5301978261f1acbfa772;hb=a506c6b73b81fac52e32b2ca31b9e92d67ae250a;hp=bd9d12d06a87b23e7c351296d9d7e45acf7b235a;hpb=355f9a0efc9f90406c69aeab8c57220d0735154c;p=lyx.git diff --git a/src/Author.cpp b/src/Author.cpp index bd9d12d06a..3d03fe7113 100644 --- a/src/Author.cpp +++ b/src/Author.cpp @@ -13,6 +13,7 @@ #include "Author.h" #include "support/convert.h" +#include "support/gettext.h" #include "support/lassert.h" #include "support/lstrings.h" @@ -48,6 +49,15 @@ Author::Author(int buffer_id) {} +docstring Author::nameAndEmail() const +{ + if (email().empty()) + return name(); + else + return bformat(_("%1$s[[name]] (%2$s[[email]])"), name(), email()); +} + + bool Author::valid() const { //this cannot be equal if the buffer_id was produced by the hash function. @@ -174,7 +184,7 @@ ostream & operator<<(ostream & os, AuthorList const & a) for (; a_it != a_end; ++a_it) { if (a_it->used() && a_it->valid()) - os << "\\author " << *a_it << "\n"; + os << "\\author " << *a_it << "\n"; } return os; }