|
3 | 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
4 | 4 |
|
5 | 5 | #include <clientversion.h> |
| 6 | +#include <util/translation.h> |
6 | 7 |
|
7 | 8 | #include <tinyformat.h> |
8 | 9 |
|
| 10 | +#include <sstream> |
| 11 | +#include <string> |
| 12 | +#include <vector> |
9 | 13 |
|
10 | 14 | /** |
11 | 15 | * Name of client reported in the 'version' message. Report the same name |
@@ -72,3 +76,32 @@ std::string FormatSubVersion(const std::string& name, int nClientVersion, const |
72 | 76 | ss << "/"; |
73 | 77 | return ss.str(); |
74 | 78 | } |
| 79 | + |
| 80 | +std::string CopyrightHolders(const std::string& strPrefix) |
| 81 | +{ |
| 82 | + const auto copyright_devs = strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION); |
| 83 | + std::string strCopyrightHolders = strPrefix + copyright_devs; |
| 84 | + |
| 85 | + // Make sure Bitcoin Core copyright is not removed by accident |
| 86 | + if (copyright_devs.find("Bitcoin Core") == std::string::npos) { |
| 87 | + strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers"; |
| 88 | + } |
| 89 | + return strCopyrightHolders; |
| 90 | +} |
| 91 | + |
| 92 | +std::string LicenseInfo() |
| 93 | +{ |
| 94 | + const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>"; |
| 95 | + |
| 96 | + return CopyrightHolders(strprintf(_("Copyright (C) %i-%i").translated, 2009, COPYRIGHT_YEAR) + " ") + "\n" + |
| 97 | + "\n" + |
| 98 | + strprintf(_("Please contribute if you find %s useful. " |
| 99 | + "Visit %s for further information about the software.").translated, PACKAGE_NAME, "<" PACKAGE_URL ">") + |
| 100 | + "\n" + |
| 101 | + strprintf(_("The source code is available from %s.").translated, URL_SOURCE_CODE) + |
| 102 | + "\n" + |
| 103 | + "\n" + |
| 104 | + _("This is experimental software.").translated + "\n" + |
| 105 | + strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s").translated, "COPYING", "<https://opensource.org/licenses/MIT>") + |
| 106 | + "\n"; |
| 107 | +} |
0 commit comments