Translate Error messages in main().

This commit is contained in:
tastytea 2021-05-21 01:48:55 +02:00
parent 7007d5e89a
commit 10e84a7707
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,7 @@
#include "options.hpp" #include "options.hpp"
#include <boost/locale/generator.hpp> #include <boost/locale/generator.hpp>
#include <boost/locale/message.hpp>
#include <boost/program_options/errors.hpp> #include <boost/program_options/errors.hpp>
#include <boost/program_options/variables_map.hpp> #include <boost/program_options/variables_map.hpp>
@ -31,6 +32,7 @@ int main(int argc, char *argv[])
{ {
namespace po = boost::program_options; namespace po = boost::program_options;
using boost::locale::translate;
using std::cerr; using std::cerr;
using std::cout; using std::cout;
@ -48,7 +50,8 @@ int main(int argc, char *argv[])
} }
catch (std::exception &e) catch (std::exception &e)
{ // Exceptions we can't recover from or ones we don't know. { // Exceptions we can't recover from or ones we don't know.
cerr << "ERROR: " << e.what() << '\n'; cerr << translate("ERROR: ") << e.what() << '\n';
cerr << translate("Error while parsing options.") << '\n';
return EXIT_FAILURE; return EXIT_FAILURE;
} }