diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-09-22 12:19:26 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-09-22 13:14:04 +0200 |
commit | dc96cb4d17d04ac5444a9eb8926b6bc9f24b41fc (patch) | |
tree | b3e836b3bb9e9fdf902c8c900bdfc53a4f42cecf /vncviewer | |
parent | b2046432794cd8a1cb7a9737329186e1fec2dcc7 (diff) | |
download | tigervnc-dc96cb4d17d04ac5444a9eb8926b6bc9f24b41fc.tar.gz tigervnc-dc96cb4d17d04ac5444a9eb8926b6bc9f24b41fc.zip |
Generate the about text in a single place
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/vncviewer.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 82286ab8..8e249377 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -77,10 +77,12 @@ using namespace network; using namespace rfb; using namespace std; -static const char aboutText[] = N_("TigerVNC Viewer %d-bit v%s (%s)\n" - "%s\n" - "Copyright (C) 1999-2013 TigerVNC Team and many others (see README.txt)\n" - "See http://www.tigervnc.org for information on TigerVNC."); +static const char _aboutText[] = N_("TigerVNC Viewer %d-bit v%s (%s)\n" + "%s\n" + "Copyright (C) 1999-2013 TigerVNC Team and many others (see README.txt)\n" + "See http://www.tigervnc.org for information on TigerVNC."); +static char aboutText[1024]; + extern const char* buildTime; char vncServerName[VNCSERVERNAMELEN] = { '\0' }; @@ -101,8 +103,7 @@ void exit_vncviewer(const char *error) void about_vncviewer() { fl_message_title(_("About TigerVNC Viewer")); - fl_message(gettext(aboutText), (int)sizeof(size_t)*8, - PACKAGE_VERSION, __BUILD__, buildTime); + fl_message("%s", aboutText); } static void about_callback(Fl_Widget *widget, void *data) @@ -361,13 +362,14 @@ int main(int argc, char** argv) bindtextdomain(PACKAGE_NAME, LOCALE_DIR); textdomain(PACKAGE_NAME); + // Generate the about string now that we get the proper translation + snprintf(aboutText, sizeof(aboutText), _aboutText, + (int)sizeof(size_t)*8, PACKAGE_VERSION, __BUILD__, buildTime); + rfb::SecurityClient::setDefaults(); // Write about text to console, still using normal locale codeset - fprintf(stderr,"\n"); - fprintf(stderr, gettext(aboutText), (int)sizeof(size_t)*8, - PACKAGE_VERSION, __BUILD__, buildTime); - fprintf(stderr,"\n"); + fprintf(stderr,"\n%s\n", aboutText); // Set gettext codeset to what our GUI toolkit uses. Since we are // passing strings from strerror/gai_strerror to the GUI, these must |