]> git.lyx.org Git - lyx.git/blobdiff - src/Author.cpp
Account for old versions of Pygments
[lyx.git] / src / Author.cpp
index bd9d12d06a87b23e7c351296d9d7e45acf7b235a..03025a38aa9910f8695039fa6b3d56a497f31c4f 100644 (file)
@@ -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.