824N/A# Copyright (c) 1999, 2013, Oracle
and/or its affiliates. All rights reserved.
824N/A# Permission is hereby granted, free of charge, to any person obtaining a
824N/A# copy of this software and associated documentation files (the "Software"),
824N/A# to deal in the Software without restriction, including without limitation
824N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
824N/A#
and/or sell copies of the Software, and to permit persons to whom the
824N/A# Software is furnished to do so, subject to the following conditions:
824N/A# The above copyright notice and this permission notice (including the next
824N/A# paragraph) shall be included in all copies or substantial portions of the
824N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
824N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
824N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
824N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
824N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
824N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
824N/A# DEALINGS IN THE SOFTWARE.
824N/AIncludes Solaris changes for:
824N/A4213490 Add support for SGML format man pages
824N/A4226089 xman utility needs to display new SunOS directories
824N/A4365478 Internationalize xman
824N/A@@ -36,6 +36,8 @@ from the X Consortium.
824N/A /* The files with the icon bits in them. */
824N/A@@ -45,6 +47,7 @@ from the X Consortium.
824N/A static void CreateOptionMenu(ManpageGlobals * man_globals, Widget parent);
824N/A static void CreateSectionMenu(ManpageGlobals * man_globals, Widget parent);
824N/A+static void CreateMoreMenu(ManpageGlobals * man_globals, Widget parent);
824N/A static void StartManpage(ManpageGlobals * man_globals, Boolean help,
824N/A static Widget *ConvertNamesToWidgets(Widget parent, const char **names);
824N/A@@ -56,6 +59,7 @@ static Widget *ConvertNamesToWidgets(Widget parent, const char **names);
824N/A@@ -216,7 +220,7 @@ CreateManpageWidget(ManpageGlobals * man_globals,
824N/A Arg arglist[MANPAGEARGS]; /* An argument list for widget creation */
824N/A Cardinal num_args; /* The number of arguments in the list. */
824N/A- Widget mytop, pane, hpane, mysections; /* Widgets */
824N/A+ Widget mytop, pane, hpane, mysections, sect1; /* Widgets */
824N/A ManPageWidgets *mpw = &(man_globals->manpagewidgets);
824N/A num_args = (Cardinal) 0;
824N/A@@ -243,8 +247,13 @@ CreateManpageWidget(ManpageGlobals * man_globals,
824N/A XtSetValues(mytop, arglist, num_args);
824N/A+ pane = XtCreateManagedWidget("Manpage_Vpane", panedWidgetClass, mytop, NULL,
824N/A pane = XtCreateManagedWidget("vertPane", panedWidgetClass, mytop, NULL,
824N/A@@ -264,16 +273,25 @@ CreateManpageWidget(ManpageGlobals * man_globals,
824N/A mysections = XtCreateManagedWidget("sections", menuButtonWidgetClass,
824N/A hpane, arglist, num_args);
824N/A+ if (sections > MAX_MENU) {
824N/A+ XtSetArg(arglist[num_args], XtNmenuName, MORE_MENU); num_args++;
824N/A+ sect1 = XtCreateManagedWidget("More...", menuButtonWidgetClass,
824N/A+ hpane, arglist, num_args);
824N/A XtSetArg(arglist[0], XtNlabel, SHOW_BOTH);
824N/A XtSetValues(man_globals->both_screens_entry, arglist, (Cardinal) 1);
824N/A MakeSearchWidget(man_globals, mytop);
824N/A CreateSectionMenu(man_globals, mytop);
824N/A+ if (sections > MAX_MENU) CreateMoreMenu(man_globals, mytop);
824N/A MakeSaveWidgets(man_globals, mytop);
824N/A XtSetSensitive(mysections, FALSE);
824N/A+ if (sections > MAX_MENU) XtSetSensitive(sect1, FALSE);
824N/A XtSetArg(arglist[0], XtNsensitive, FALSE);
824N/A XtSetValues(man_globals->dir_entry, arglist, ONE);
824N/A XtSetValues(man_globals->manpage_entry, arglist, ONE);
824N/A@@ -287,8 +305,13 @@ CreateManpageWidget(ManpageGlobals * man_globals,
824N/A XtSetValues(man_globals->print_entry, arglist, ONE);
824N/A #endif /* INCLUDE_XPRINT_SUPPORT */
824N/A+ man_globals->label = XtCreateManagedWidget(MANNAME, labelWidgetClass,
824N/A+ hpane, NULL, (Cardinal) 0);
824N/A man_globals->label = XtCreateManagedWidget("manualTitle", labelWidgetClass,
824N/A hpane, NULL, (Cardinal) 0);
824N/A@@ -336,7 +359,7 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page)
824N/A- strcpy(man_globals->manpage_title, "Xman Help");
824N/A+ strcpy(man_globals->manpage_title, gettext("Xman Help"));
824N/A if (man_globals->both_shown) {
824N/A@@ -528,7 +551,7 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
824N/A menu = XtCreatePopupShell(SECTION_MENU, simpleMenuWidgetClass, parent,
824N/A- for (i = 0; i < sections; i++) {
824N/A+ for (i = 0; i < ((sections <= MAX_MENU) ? sections:sections/2) ; i++) {
824N/A XtSetArg(args[num_args], XtNlabel, manual[i].blabel);
824N/A@@ -547,6 +570,35 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
824N/A+CreateMoreMenu(ManpageGlobals * man_globals, Widget parent)
824N/A+ MenuStruct * menu_struct;
+ char entry_name[BUFSIZ];
+ menu = XtCreatePopupShell(MORE_MENU, simpleMenuWidgetClass, parent,
+ for (i = sections/2-1 ; i < sections ; i ++) {
+ XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++;
+ snprintf(entry_name, sizeof(entry_name), "section%d", i);
+ entry = XtCreateManagedWidget(entry_name, smeBSBObjectClass,
+ menu_struct = (MenuStruct *) XtMalloc(sizeof(MenuStruct));
+ menu_struct->data = (caddr_t) man_globals;
+ menu_struct->number = i;
+ XtAddCallback(entry, XtNcallback, DirPopupCallback, (caddr_t) menu_struct);
+ XtAddCallback(entry, XtNdestroyCallback,MenuDestroy, (caddr_t)menu_struct);
/* Function Name: CreateList
* Description: this function prints a label in the directory list
* Arguments: section - the manual section.
@@ -592,7 +644,7 @@ MakeDirectoryBox(ManpageGlobals * man_globals, Widget parent, Widget * dir_disp,
name = manual[section].blabel; /* Set the section name */
- snprintf(label_name, sizeof(label_name), "Directory of: %s", name);
+ snprintf(label_name, sizeof(label_name), gettext("Directory of: %s"),name);
man_globals->section_name[section] = XtNewString(label_name);
@@ -691,7 +743,7 @@ FormUpWidgets(Widget parent, const char **full_size, const char **half_size)
if (long_widget == (Widget) NULL) { /* Make sure we found one. */
PopupWarning(GetGlobals(parent),
- "Could not find longest widget, aborting...");
+ gettext("Could not find longest widget, aborting..."));
XtFree((char *) full_widgets);
XtFree((char *) half_widgets);
@@ -759,7 +811,7 @@ ConvertNamesToWidgets(Widget parent, const char **names)
snprintf(error_buf, sizeof(error_buf),
- "Could not find widget named '%s'", *names);
+ gettext("Could not find widget named '%s'"), *names);
index fe09b6b..22da1c7 100644
@@ -53,6 +53,7 @@ from the X Consortium.
#define OPTION_MENU "optionMenu" /* Name of the Option Menu. */
#define SECTION_MENU "sectionMenu" /* Name of the Section Menu. */
+#define MORE_MENU "moreMenu" /* Name of the More... Menu. */
#define HELP_BUTTON "helpButton" /* Name of top help button */
#define QUIT_BUTTON "quitButton" /* Name of top quit button */
index e61687e..351f60f 100644
@@ -41,6 +41,8 @@ from the X Consortium.
#ifdef INCLUDE_XPRINT_SUPPORT
@@ -309,8 +311,10 @@ SaveFormattedPage(Widget w, XEvent * event, String * params,
char cmdbuf[BUFSIZ], error_buf[BUFSIZ];
- XtAppWarning(XtWidgetToApplicationContext(w),
- "Xman - SaveFormattedPage: This action routine requires one argument.");
+ snprintf(error_buf, sizeof(error_buf),
+ gettext("%s This action routine requires one argument."),
+ "Xman - SaveFormattedPage:");
+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
@@ -347,14 +351,14 @@ SaveFormattedPage(Widget w, XEvent * event, String * params,
/* make sure the formatted man page is fully accessible by the world */
if (chmod(man_globals->save_file, CHMOD_MODE) != 0) {
snprintf(error_buf, sizeof(error_buf),
- "Couldn't set permissions on formatted man page '%s'.\n",
+ gettext("Couldn't set permissions on formatted man page '%s'.\n"),
PopupWarning(man_globals, error_buf);
snprintf(error_buf, sizeof(error_buf),
- "Error while executing the command '%s'.\n", cmdbuf);
+ gettext("Error while executing the command '%s'.\n"), cmdbuf);
PopupWarning(man_globals, error_buf);
@@ -362,8 +366,9 @@ SaveFormattedPage(Widget w, XEvent * event, String * params,
- PopupWarning(man_globals, "Xman - SaveFormattedPage: "
- "Unknown argument must be either 'Save' or 'Cancel'.");
+ snprintf(error_buf, sizeof(error_buf), "%s %s", "Xman - SaveFormattedPage:",
+ gettext("Unknown argument must be either 'Save' or 'Cancel'."));
+ PopupWarning(man_globals, error_buf);
@@ -394,10 +399,13 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
ManpageGlobals *man_globals;
+ char error_buf[BUFSIZ];
- XtAppWarning(XtWidgetToApplicationContext(w),
- "Xman - GotoPage: This action routine requires one argument.");
+ snprintf(error_buf, sizeof(error_buf),
+ gettext("%s This action routine requires one argument."),
+ gettext("Xman - GotoPage:"));
+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
@@ -431,8 +439,8 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
XtAppWarning(XtWidgetToApplicationContext(w),
- "Xman - GotoPage: Unknown argument must be "
- "either Manpage or Directory.");
+ gettext("Xman - GotoPage: Unknown argument must be "
+ "either Manpage or Directory."));
@@ -553,12 +561,15 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
ManpageGlobals *man_globals = GetGlobals(w);
+ char error_buf[BUFSIZ];
XtPopdown(XtParent(XtParent(w))); /* popdown the search widget */
if ((*num_params < 1) || (*num_params > 2)) {
- XtAppWarning(XtWidgetToApplicationContext(w),
- "Xman - Search: This action routine requires one or two arguments.");
+ snprintf(error_buf, sizeof(error_buf),
+ gettext("%s This action routine requires one or two arguments."),
+ gettext("Xman - Search:"));
+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
@@ -576,8 +587,10 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
- XtAppWarning(XtWidgetToApplicationContext(w),
- "Xman - Search: First parameter unknown.");
+ snprintf(error_buf, sizeof(error_buf),
+ gettext("%s First parameter unknown."),
+ gettext("Xman - Search:"));
+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
@@ -604,8 +617,9 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
- XtAppWarning(XtWidgetToApplicationContext(w),
- "Xman - Search: Second parameter unknown.");
+ snprintf(error_buf, sizeof(error_buf),
+ gettext("%s Second parameter unknown."), "Xman - Search:");
+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
@@ -35,6 +35,8 @@ from the X Consortium.
/* Function Name: MakeHelpWidget.
* Description: This function creates the help widget so that it will be
@@ -66,7 +68,7 @@ MakeHelpWidget(void)
- ChangeLabel(man_globals->label, "Xman Help");
+ ChangeLabel(man_globals->label, gettext("Xman Help"));
XtRealizeWidget(help_widget);
@@ -99,7 +101,7 @@ OpenHelpfile(ManpageGlobals * man_globals)
PopupWarning(man_globals,
- "Could not open help file, NO HELP WILL BE AVAILABLE.");
+ gettext("Could not open help file, NO HELP WILL BE AVAILABLE."));
@@ -35,6 +35,8 @@ from the X Consortium.
@@ -145,6 +147,7 @@ main(int argc, char **argv)
saved_argv = (char **) XtMalloc(argc * sizeof(char *));
bcopy(argv, saved_argv, argc * sizeof(char *));
@@ -157,6 +160,13 @@ main(int argc, char **argv)
XInternAtom(XtDisplay(initial_widget), "WM_DELETE_WINDOW", False);
+ if ((domaindir = getenv("TEXTDOMAINDIR")) == NULL) {
+ bindtextdomain("xman", domaindir);
manglobals_context = XStringToContext(MANNAME);
@@ -173,10 +183,10 @@ main(int argc, char **argv)
XtAppAddActions(app_con, xman_actions, XtNumber(xman_actions));
- PrintError("Failed to get the directory font.");
+ PrintError(gettext("Failed to get the directory font."));
- printf("debugging mode\n");
+ printf(gettext("debugging mode\n"));
@@ -195,7 +205,7 @@ main(int argc, char **argv)
if ((sections = Man()) == 0)
- ("There are no manual sections to display, check your MANPATH.");
+ (gettext("There are no manual sections to display, check your MANPATH."));
@@ -229,42 +239,53 @@ ArgError(int argc, char **argv)
- static const char **syntax, *syntax_def[] = {
- "-help", "Print this message",
- "-helpfile <filename>", "Specifies the helpfile to use.",
- "-bothshown", "Show both the directory and manpage at once.",
- "-notopbox", "Starts with manpage rather than topbox.",
- "-geometry <geom>", "Specifies the geometry of the top box.",
- "=<geom>", "Specifies the geometry of the top box.",
- "-pagesize <geom>", "Specifies the geometry of the manual page.",
- "-bw <pixels>", "Width of all window borders.",
- "-borderwidth <pixels>", "Width of all window borders.",
- "-bd <color>", "Color of all window borders.",
- "-bordercolor <color>", "Color of all window borders.",
- "-fg <color>", "Foreground color for the application.",
- "-foreground <color>", "Foreground color for the application.",
- "-bg <color>", "Background color for the application.",
- "-background <color>", "Background color for the application.",
- "-display <display name>", "Specify a display that is not the default",
- "-fn <font>", "Font to be used for button and label text.",
- "-font <font>", "Font to be used for button and label text.",
- "-name <name>", "Change the name used for retrieving resources.",
- "-title <name>", "Change the name without affecting resources.",
- "-xrm <resource>", "Specifies a resource on the command line.",
for (i = 1; i < argc; i++)
- (void) printf("This argument is unknown to Xman: %s\n", argv[i]);
- (void) printf("\nKnown arguments are:\n");
- while (*syntax != NULL) {
- printf("%-30s - %s\n", syntax[0], syntax[1]);
+ (void) printf(gettext("This argument is unknown to Xman: %s\n"), argv[i]);
+ (void) printf(gettext("\nKnown arguments are:\n"));
+ gettext("Print this message"));
+ printf("-helpfile %s - %s\n", gettext("<filename> "),
+ gettext("Specifies the helpfile to use."));
+ printf("-bothshown - %s\n",
+ gettext("Show both the directory and manpage at once."));
+ printf("-notopbox - %s\n",
+ gettext("Starts with manpage rather than topbox."));
+ printf("-geometry %s - %s\n", gettext("<geom> "),
+ gettext("Specifies the geometry of the top box."));
+ printf("=%s - %s\n", gettext("<geom> "),
+ gettext("Specifies the geometry of the top box."));
+ printf("-pagesize %s - %s\n", gettext("<geom> "),
+ gettext("Specifies the geometry of the manual page."));
+ printf("-bw %s - %s\n", gettext("<pixels> "),
+ gettext("Width of all window borders."));
+ printf("-borderwidth %s - %s\n", gettext("<pixels> "),
+ gettext("Width of all window borders."));
+ printf("-bd %s - %s\n", gettext("<color> "),
+ gettext("Color of all window borders."));
+ printf("-bordercolor %s - %s\n", gettext("<color> "),
+ gettext("Color of all window borders."));
+ printf("-fg %s - %s\n", gettext("<color> "),
+ gettext("Foreground color for the application."));
+ printf("-foreground %s - %s\n", gettext("<color> "),
+ gettext("Foreground color for the application."));
+ printf("-bg %s - %s\n", gettext("<color> "),
+ gettext("Background color for the application."));
+ printf("-background %s - %s\n", gettext("<color> "),
+ gettext("Background color for the application."));
+ printf("-display %s - %s\n", gettext("<display name> "),
+ gettext("Specify a display that is not the default"));
+ printf("-fn %s - %s\n", gettext("<font> "),
+ gettext("Font to be used for button and label text."));
+ printf("-font %s - %s\n", gettext("<font> "),
+ gettext("Font to be used for button and label text."));
+ printf("-name %s - %s\n", gettext("<name> "),
+ gettext("Change the name used for retrieving resources."));
+ printf("-title %s - %s\n", gettext("<name> "),
+ gettext("Change the name without affecting resources."));
+ printf("-xrm %s - %s\n", gettext("<resource> "),
+ gettext("Specifies a resource on the command line."));
/* Function Name: AdjustDefResources
index e8432f0..5963a86 100644
@@ -31,6 +31,8 @@ from the X Consortium.
#include "
vendor.h" /* vendor-specific defines and data */
@@ -157,7 +159,7 @@ Man(void)
(sizeof(Manual) * num_alloced));
- ("Could not allocate memory for manual sections.");
+ (gettext("Could not allocate memory for manual sections."));
InitManual(manual + sect, list->label);
manual[sect].flags = list->flags;
@@ -184,10 +186,10 @@ Man(void)
- PrintError("No manual pages found.");
+ PrintError(gettext("No manual pages found."));
manual = (Manual *) XtRealloc((char *) manual, (sizeof(Manual) * sect));
- PrintError("Could not allocate memory for manual sections.");
+ PrintError(gettext("Could not allocate memory for manual sections."));
return (sect); /* return the number of man sections. */
@@ -209,7 +211,7 @@ SortList(SectionList ** list)
SectionList *head, *last, *inner, *old;
- PrintError("No manual sections to read, exiting.");
+ PrintError(gettext("No manual sections to read, exiting."));
@@ -421,7 +423,7 @@ ReadCurrentSection(Manual * local_manual, char *path)
if ((dir = opendir(path)) == NULL) {
- snprintf(error_buf, sizeof(error_buf), "Can't open directory %s", path);
+ snprintf(error_buf, sizeof(error_buf), gettext("Can't open directory %s"), path);
PopupWarning(NULL, error_buf);
@@ -507,7 +509,7 @@ ReadCurrentSection(Manual * local_manual, char *path)
local_manual->entries_less_paths[nentries] =
strrchr(local_manual->entries[nentries], '/');
if (local_manual->entries_less_paths[nentries] == NULL)
- PrintError("Internal error while cataloging manual pages.");
+ PrintError(gettext("Internal error while cataloging manual pages."));
@@ -535,7 +537,7 @@ SortAndRemove(Manual * man, int number)
- printf("sorting section %d - %s\n", i, man->blabel);
+ printf(gettext("sorting section %d - %s\n"), i, man->blabel);
s1 = (char **) malloc(man->nentries * sizeof(char *));
@@ -570,13 +572,13 @@ SortAndRemove(Manual * man, int number)
l2 = man->entries_less_paths[j++];
- ("Internal error while removing duplicate manual pages.");
+ (gettext("Internal error while removing duplicate manual pages."));
l2 = man->entries_less_paths[j++];
- ("Internal error while removing duplicate manual pages.");
+ (gettext("Internal error while removing duplicate manual pages."));
@@ -931,7 +933,7 @@ DumpManual(int number)
for (i = 0; i < number; i++) {
- printf("label: %s\n", manual[i].blabel);
+ printf("gettext(label: %s\n"), manual[i].blabel);
for (j = 0; j < manual[i].nentries; j++)
printf("%s\n", manual[i].entries[j]);
@@ -40,6 +40,8 @@ from the X Consortium.
@@ -93,7 +95,7 @@ PopupWarning(ManpageGlobals * man_globals, const char *string)
- snprintf(buffer, sizeof(buffer), "Xman Warning: %s", string);
+ snprintf(buffer, sizeof(buffer), gettext("Xman Warning: %s"), string);
@@ -138,7 +140,7 @@ PopupWarning(ManpageGlobals * man_globals, const char *string)
PrintError(const char *string)
- fprintf(stderr, "Xman Error: %s\n", string);
+ fprintf(stderr, gettext("Xman Error: %s\n"), string);
@@ -202,7 +204,7 @@ FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num)
temp = CreateManpageName(entry, 0, 0);
snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title),
- "The current manual page is: %s.", temp);
+ gettext("The current manual page is: %s."), temp);
ParseEntry(entry, path, section, page);
@@ -349,8 +351,8 @@ Uncompress(ManpageGlobals * man_globals, const char *filename)
if (!UncompressNamed(man_globals, filename, tmp_file, &file)) {
- PopupWarning(man_globals, "Something went wrong in retrieving the "
- "uncompressed manual page try cleaning up /tmp.");
+ PopupWarning(man_globals, gettext("Something went wrong in retrieving "
+ "the uncompressed manual page. Try cleaning up /tmp."));
@@ -379,8 +381,8 @@ UncompressNamed(ManpageGlobals * man_globals, const char *filename,
if (stat(filename, &junk) != 0) { /* Check for existence of the file. */
snprintf(error_buf, sizeof(error_buf),
- "Error while stating file %s, errno = %d", filename,
+ gettext("Error while stating file %s, errno = %d"),
PopupWarning(man_globals, error_buf);
@@ -394,7 +396,7 @@ UncompressNamed(ManpageGlobals * man_globals, const char *filename,
strcpy(tmp, MANTEMP); /* get a temp file. */
- PopupWarning(man_globals, "Error creating a temp file");
+ PopupWarning(man_globals, gettext("Error creating a temp file"));
*output_file = fdopen(fd, "r");
@@ -429,7 +431,7 @@ UncompressNamed(ManpageGlobals * man_globals, const char *filename,
snprintf(error_buf, sizeof(error_buf),
- "Error while uncompressing, command was: %s", cmdbuf);
+ gettext("Error while uncompressing, command was: %s"), cmdbuf);
PopupWarning(man_globals, error_buf);
@@ -515,7 +517,7 @@ Format(ManpageGlobals * man_globals, const char *entry)
if (!UncompressUnformatted(man_globals, entry, filename, &file)) {
/* We Really could not find it, this should never happen, yea right. */
snprintf(error_buf, sizeof(error_buf),
- "Could not open manual page, %s", entry);
+ gettext("Could not open manual page, %s"), entry);
PopupWarning(man_globals, error_buf);
XtPopdown(XtParent(man_globals->standby));
@@ -577,12 +579,22 @@ Format(ManpageGlobals * man_globals, const char *entry)
ParseEntry(entry, path, sect, NULL);
+#ifdef SFORMAT /* Handle Solaris SGML pages */
+ snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s | %s %s >> %s %s",
+ path, SFORMAT, filename, TBL, FORMAT, man_globals->tempfile,
snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s >> %s %s", path, TBL,
filename, FORMAT, man_globals->tempfile, "2>
/dev/null");
/* Handle more flexible way of specifying the formatting pipeline */
if (!ConstructCommand(cmdbuf, path, filename, man_globals->tempfile)) {
- PopupWarning(man_globals, "Constructed command was too long!");
+ PopupWarning(man_globals, gettext("Constructed command was too long!"));
@@ -591,7 +603,7 @@ Format(ManpageGlobals * man_globals, const char *entry)
if (system(cmdbuf) != 0) { /* execute search. */
snprintf(error_buf, sizeof(error_buf),
- "Something went wrong trying to run the command: %s", cmdbuf);
+ gettext("Something went wrong trying to run the command: %s"), cmdbuf);
PopupWarning(man_globals, error_buf);
@@ -1000,7 +1012,7 @@ AddCursor(Widget w, Cursor cursor)
- PopupWarning(NULL, "Widget is not realized, no cursor added.\n");
+ PopupWarning(NULL, gettext("Widget is not realized, no cursor added.\n"));
@@ -1114,14 +1126,14 @@ ParseEntry(const char *entry, char *path, char *sect, char *page)
- PrintError("Failed to find / in ParseEntry.");
+ PrintError(gettext("Failed to find / in ParseEntry."));
- PrintError("Failed to find / in ParseEntry.");
+ PrintError(gettext("Failed to find / in ParseEntry."));
#if defined(SFORMAT) && defined(SMAN)
/* sgmltoroff sometimes puts an extra ./ in the path to .so entries */
@@ -1168,12 +1180,12 @@ GetGlobals(Widget w)
XtAppError(XtWidgetToApplicationContext(w),
- "Xman: Could not locate widget in tree, exiting");
+ gettext("Xman: Could not locate widget in tree, exiting"));
if (XFindContext(XtDisplay(w), XtWindow(w),
manglobals_context, &data) != XCSUCCESS)
XtAppError(XtWidgetToApplicationContext(w),
- "Xman: Could not find global data, exiting");
+ gettext("Xman: Could not find global data, exiting"));
return ((ManpageGlobals *) data);
@@ -1195,7 +1207,7 @@ SaveGlobals(Widget w, ManpageGlobals * globals)
if (XSaveContext(XtDisplay(w), XtWindow(w), manglobals_context,
(caddr_t) globals) != XCSUCCESS)
XtAppError(XtWidgetToApplicationContext(w),
- "Xman: Could not save global data, are you out of memory?");
+ gettext("Xman: Could not save global data, are you out of memory?"));
/* Function Name: RemoveGlobals
@@ -1213,5 +1225,5 @@ RemoveGlobals(Widget w)
if (XDeleteContext(XtDisplay(w), XtWindow(w),
manglobals_context) != XCSUCCESS)
XtAppError(XtWidgetToApplicationContext(w),
- "Xman: Could not remove global data?");
+ gettext("Xman: Could not remove global data?"));
index c28b997..749fe61 100644
@@ -31,6 +31,8 @@ from the X Consortium.
/* Map <CR> and control-M to goto beginning of file. */
@@ -68,7 +70,7 @@ MakeSearchWidget(ManpageGlobals * man_globals, Widget parent)
if ((text = XtNameToWidget(dialog, "value")) == (Widget) NULL)
- PopupWarning(NULL, "Could not find text widget in MakeSearchWidget.");
+ PopupWarning(NULL, gettext("Could not find text widget in MakeSearchWidget."));
XtSetKeyboardFocus(dialog, text);
@@ -84,7 +86,7 @@ MakeSearchWidget(ManpageGlobals * man_globals, Widget parent)
if (((command = XtNameToWidget(dialog, MANUALSEARCH)) == (Widget) NULL) ||
((cancel = XtNameToWidget(dialog, CANCEL)) == (Widget) NULL))
- "Could not find manual search widget in MakeSearchWidget.");
+ gettext("Could not find manual search widget in MakeSearchWidget."));
static const char *half_size[] = {
MANUALSEARCH, APROPOSSEARCH, NULL
@@ -120,7 +122,7 @@ SearchString(ManpageGlobals * man_globals)
return (XawDialogGetValueString(dialog));
PopupWarning(man_globals,
- "Could not get the search string, no search will be preformed.");
+ gettext("Could not get the search string, no search will be performed."));
@@ -163,16 +165,16 @@ DoSearch(ManpageGlobals * man_globals, int type)
/* If the string is empty or starts with a space then do not search */
if (streq(search_string, "")) {
- PopupWarning(man_globals, "Search string is empty.");
+ PopupWarning(man_globals, gettext("Search string is empty."));
if (strlen(search_string) >= BUFSIZ) {
- PopupWarning(man_globals, "Search string too long.");
+ PopupWarning(man_globals, gettext("Search string too long."));
if (search_string[0] == ' ') {
- PopupWarning(man_globals, "First character cannot be a space.");
+ PopupWarning(man_globals, gettext("First character cannot be a space."));
@@ -205,7 +207,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
snprintf(label, sizeof(label),
- "Results of apropos search on: %s", search_string);
+ gettext("Results of apropos search on: %s"), search_string);
#ifdef NO_MANPATH_SUPPORT /* not quite correct, but the best I can do. */
snprintf(cmdbuf, sizeof(cmdbuf), APROPOS_FORMAT, search_string, mantmp);
@@ -216,12 +218,12 @@ DoSearch(ManpageGlobals * man_globals, int type)
if (system(cmdbuf) != 0) { /* execute search. */
snprintf(error_buf, sizeof(error_buf),
- "Something went wrong trying to run %s\n", cmdbuf);
+ gettext("Something went wrong trying to run %s\n"), cmdbuf);
PopupWarning(man_globals, error_buf);
if ((file = fdopen(fd, "r")) == NULL)
- PrintError("lost temp file? out of temp space?");
+ PrintError(gettext("lost temp file? out of temp space?"));
* Since we keep the FD open we can remove the file safely, this
@@ -230,8 +232,8 @@ DoSearch(ManpageGlobals * man_globals, int type)
- snprintf(string_buf, sizeof(string_buf), "%s: nothing appropriate",
+ snprintf(string_buf, sizeof(string_buf),
+ gettext("%s: nothing appropriate"), search_string);
* Check first LOOKLINES lines for "nothing appropriate".
@@ -270,8 +272,8 @@ DoSearch(ManpageGlobals * man_globals, int type)
else { /* MANUAL SEARCH */
file = DoManualSearch(man_globals, search_string);
- snprintf(string_buf, sizeof(string_buf), "No manual entry for %s.",
+ snprintf(string_buf, sizeof(string_buf),
+ gettext("No manual entry for %s."), search_string);
ChangeLabel(man_globals->label, string_buf);
if (man_globals->label == NULL)
PopupWarning(man_globals, string_buf);
@@ -286,6 +288,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
dialog = XtNameToWidget(man_globals->search_widget, DIALOG);
PopupWarning(man_globals, "Could not clear the search string.");
+ PopupWarning(man_globals, gettext("Could not clear the search string."));
XtSetArg(arglist[0], XtNvalue, "");
XtSetValues(dialog, arglist, (Cardinal) 1);
@@ -372,7 +375,7 @@ BEntrySearch(char *string, char **first, int number)
head = strrchr(first[global_number + check], '/');
- PrintError("index failure in BEntrySearch");
+ PrintError(gettext("index failure in BEntrySearch"));
tail = strrchr(head, '.');
index 903fc8c..0940f24 100644
@@ -32,6 +32,8 @@ from the X Consortium.
typedef struct sectionName {
@@ -229,11 +231,11 @@ AddStandardSections(SectionList ** list, const char *path)
for (i = 0; i < numSections; i++) {
snprintf(file, sizeof(file), "%s%s", SEARCHDIR, SectionNames[i].suffix);
- AddNewSection(list, path, file, SectionNames[i].name, TRUE);
+ AddNewSection(list, path, file, gettext(SectionNames[i].name), TRUE);
snprintf(file, sizeof(file), "%s%s", SEARCHOTHER,
- AddNewSection(list, path, file, SectionNames[i].name, TRUE);
+ AddNewSection(list, path, file, gettext(SectionNames[i].name), TRUE);