2 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the "Software"),
6 # to deal in the Software without restriction, including without limitation
7 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 # and/or sell copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice (including the next
12 # paragraph) shall be included in all copies or substantial portions of the
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 # DEALINGS IN THE SOFTWARE.
24 Includes Solaris changes for:
25 4213490 Add support for SGML format man pages
26 4226089 xman utility needs to display new SunOS directories
27 4365478 Internationalize xman
29 diff --git a/buttons.c b/buttons.c
30 index 4e5ed3c..e42c431 100644
33 @@ -36,6 +36,8 @@ from the X Consortium.
38 +#include <X11/Xlocale.h>
40 /* The files with the icon bits in them. */
42 @@ -45,6 +47,7 @@ from the X Consortium.
44 static void CreateOptionMenu(ManpageGlobals * man_globals, Widget parent);
45 static void CreateSectionMenu(ManpageGlobals * man_globals, Widget parent);
46 +static void CreateMoreMenu(ManpageGlobals * man_globals, Widget parent);
47 static void StartManpage(ManpageGlobals * man_globals, Boolean help,
49 static Widget *ConvertNamesToWidgets(Widget parent, const char **names);
50 @@ -56,6 +59,7 @@ static Widget *ConvertNamesToWidgets(Widget parent, const char **names);
56 Widget top; /* needed in PopupWarning, misc.c */
58 @@ -216,7 +220,7 @@ CreateManpageWidget(ManpageGlobals * man_globals,
60 Arg arglist[MANPAGEARGS]; /* An argument list for widget creation */
61 Cardinal num_args; /* The number of arguments in the list. */
62 - Widget mytop, pane, hpane, mysections; /* Widgets */
63 + Widget mytop, pane, hpane, mysections, sect1; /* Widgets */
64 ManPageWidgets *mpw = &(man_globals->manpagewidgets);
66 num_args = (Cardinal) 0;
67 @@ -243,8 +247,13 @@ CreateManpageWidget(ManpageGlobals * man_globals,
69 XtSetValues(mytop, arglist, num_args);
72 + pane = XtCreateManagedWidget("Manpage_Vpane", panedWidgetClass, mytop, NULL,
75 pane = XtCreateManagedWidget("vertPane", panedWidgetClass, mytop, NULL,
79 /* Create menu bar. */
81 @@ -264,16 +273,25 @@ CreateManpageWidget(ManpageGlobals * man_globals,
82 mysections = XtCreateManagedWidget("sections", menuButtonWidgetClass,
83 hpane, arglist, num_args);
85 + if (sections > MAX_MENU) {
87 + XtSetArg(arglist[num_args], XtNmenuName, MORE_MENU); num_args++;
88 + sect1 = XtCreateManagedWidget("More...", menuButtonWidgetClass,
89 + hpane, arglist, num_args);
92 XtSetArg(arglist[0], XtNlabel, SHOW_BOTH);
93 XtSetValues(man_globals->both_screens_entry, arglist, (Cardinal) 1);
96 MakeSearchWidget(man_globals, mytop);
97 CreateSectionMenu(man_globals, mytop);
98 + if (sections > MAX_MENU) CreateMoreMenu(man_globals, mytop);
99 MakeSaveWidgets(man_globals, mytop);
102 XtSetSensitive(mysections, FALSE);
103 + if (sections > MAX_MENU) XtSetSensitive(sect1, FALSE);
104 XtSetArg(arglist[0], XtNsensitive, FALSE);
105 XtSetValues(man_globals->dir_entry, arglist, ONE);
106 XtSetValues(man_globals->manpage_entry, arglist, ONE);
107 @@ -287,8 +305,13 @@ CreateManpageWidget(ManpageGlobals * man_globals,
108 XtSetValues(man_globals->print_entry, arglist, ONE);
109 #endif /* INCLUDE_XPRINT_SUPPORT */
112 + man_globals->label = XtCreateManagedWidget(MANNAME, labelWidgetClass,
113 + hpane, NULL, (Cardinal) 0);
115 man_globals->label = XtCreateManagedWidget("manualTitle", labelWidgetClass,
116 hpane, NULL, (Cardinal) 0);
119 /* Create Directory */
121 @@ -336,7 +359,7 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page)
125 - strcpy(man_globals->manpage_title, "Xman Help");
126 + strcpy(man_globals->manpage_title, gettext("Xman Help"));
128 if (man_globals->both_shown) {
130 @@ -528,7 +551,7 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
131 menu = XtCreatePopupShell(SECTION_MENU, simpleMenuWidgetClass, parent,
134 - for (i = 0; i < sections; i++) {
135 + for (i = 0; i < ((sections <= MAX_MENU) ? sections:sections/2) ; i++) {
137 XtSetArg(args[num_args], XtNlabel, manual[i].blabel);
139 @@ -547,6 +570,35 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
144 +CreateMoreMenu(ManpageGlobals * man_globals, Widget parent)
146 + Widget menu, entry;
148 + MenuStruct * menu_struct;
151 + char entry_name[BUFSIZ];
153 + menu = XtCreatePopupShell(MORE_MENU, simpleMenuWidgetClass, parent,
154 + NULL, (Cardinal) 0);
156 + for (i = sections/2-1 ; i < sections ; i ++) {
158 + XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++;
159 + snprintf(entry_name, sizeof(entry_name), "section%d", i);
161 + entry = XtCreateManagedWidget(entry_name, smeBSBObjectClass,
162 + menu, args, num_args);
163 + menu_struct = (MenuStruct *) XtMalloc(sizeof(MenuStruct));
164 + menu_struct->data = (caddr_t) man_globals;
165 + menu_struct->number = i;
166 + XtAddCallback(entry, XtNcallback, DirPopupCallback, (caddr_t) menu_struct);
167 + XtAddCallback(entry, XtNdestroyCallback,MenuDestroy, (caddr_t)menu_struct);
172 /* Function Name: CreateList
173 * Description: this function prints a label in the directory list
174 * Arguments: section - the manual section.
175 @@ -592,7 +644,7 @@ MakeDirectoryBox(ManpageGlobals * man_globals, Widget parent, Widget * dir_disp,
178 name = manual[section].blabel; /* Set the section name */
179 - snprintf(label_name, sizeof(label_name), "Directory of: %s", name);
180 + snprintf(label_name, sizeof(label_name), gettext("Directory of: %s"),name);
181 man_globals->section_name[section] = XtNewString(label_name);
184 @@ -691,7 +743,7 @@ FormUpWidgets(Widget parent, const char **full_size, const char **half_size)
186 if (long_widget == (Widget) NULL) { /* Make sure we found one. */
187 PopupWarning(GetGlobals(parent),
188 - "Could not find longest widget, aborting...");
189 + gettext("Could not find longest widget, aborting..."));
190 XtFree((char *) full_widgets);
191 XtFree((char *) half_widgets);
193 @@ -759,7 +811,7 @@ ConvertNamesToWidgets(Widget parent, const char **names)
194 char error_buf[BUFSIZ];
196 snprintf(error_buf, sizeof(error_buf),
197 - "Could not find widget named '%s'", *names);
198 + gettext("Could not find widget named '%s'"), *names);
199 PrintError(error_buf);
200 XtFree((char *) ids);
202 diff --git a/defs.h b/defs.h
203 index fe09b6b..22da1c7 100644
206 @@ -53,6 +53,7 @@ from the X Consortium.
208 #define OPTION_MENU "optionMenu" /* Name of the Option Menu. */
209 #define SECTION_MENU "sectionMenu" /* Name of the Section Menu. */
210 +#define MORE_MENU "moreMenu" /* Name of the More... Menu. */
212 #define HELP_BUTTON "helpButton" /* Name of top help button */
213 #define QUIT_BUTTON "quitButton" /* Name of top quit button */
214 diff --git a/handler.c b/handler.c
215 index e61687e..351f60f 100644
218 @@ -41,6 +41,8 @@ from the X Consortium.
219 #include <sys/stat.h>
222 +#include <libintl.h>
223 +#include <X11/Xlocale.h>
224 #ifdef INCLUDE_XPRINT_SUPPORT
225 #include "printdialog.h"
227 @@ -309,8 +311,10 @@ SaveFormattedPage(Widget w, XEvent * event, String * params,
228 char cmdbuf[BUFSIZ], error_buf[BUFSIZ];
230 if (*num_params != 1) {
231 - XtAppWarning(XtWidgetToApplicationContext(w),
232 - "Xman - SaveFormattedPage: This action routine requires one argument.");
233 + snprintf(error_buf, sizeof(error_buf),
234 + gettext("%s This action routine requires one argument."),
235 + "Xman - SaveFormattedPage:");
236 + XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
240 @@ -347,14 +351,14 @@ SaveFormattedPage(Widget w, XEvent * event, String * params,
241 /* make sure the formatted man page is fully accessible by the world */
242 if (chmod(man_globals->save_file, CHMOD_MODE) != 0) {
243 snprintf(error_buf, sizeof(error_buf),
244 - "Couldn't set permissions on formatted man page '%s'.\n",
245 + gettext("Couldn't set permissions on formatted man page '%s'.\n"),
246 man_globals->save_file);
247 PopupWarning(man_globals, error_buf);
251 snprintf(error_buf, sizeof(error_buf),
252 - "Error while executing the command '%s'.\n", cmdbuf);
253 + gettext("Error while executing the command '%s'.\n"), cmdbuf);
254 PopupWarning(man_globals, error_buf);
257 @@ -362,8 +366,9 @@ SaveFormattedPage(Widget w, XEvent * event, String * params,
261 - PopupWarning(man_globals, "Xman - SaveFormattedPage: "
262 - "Unknown argument must be either 'Save' or 'Cancel'.");
263 + snprintf(error_buf, sizeof(error_buf), "%s %s", "Xman - SaveFormattedPage:",
264 + gettext("Unknown argument must be either 'Save' or 'Cancel'."));
265 + PopupWarning(man_globals, error_buf);
269 @@ -394,10 +399,13 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
270 ManpageGlobals *man_globals;
273 + char error_buf[BUFSIZ];
275 if (*num_params != 1) {
276 - XtAppWarning(XtWidgetToApplicationContext(w),
277 - "Xman - GotoPage: This action routine requires one argument.");
278 + snprintf(error_buf, sizeof(error_buf),
279 + gettext("%s This action routine requires one argument."),
280 + gettext("Xman - GotoPage:"));
281 + XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
285 @@ -431,8 +439,8 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
288 XtAppWarning(XtWidgetToApplicationContext(w),
289 - "Xman - GotoPage: Unknown argument must be "
290 - "either Manpage or Directory.");
291 + gettext("Xman - GotoPage: Unknown argument must be "
292 + "either Manpage or Directory."));
296 @@ -553,12 +561,15 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
298 ManpageGlobals *man_globals = GetGlobals(w);
300 + char error_buf[BUFSIZ];
302 XtPopdown(XtParent(XtParent(w))); /* popdown the search widget */
304 if ((*num_params < 1) || (*num_params > 2)) {
305 - XtAppWarning(XtWidgetToApplicationContext(w),
306 - "Xman - Search: This action routine requires one or two arguments.");
307 + snprintf(error_buf, sizeof(error_buf),
308 + gettext("%s This action routine requires one or two arguments."),
309 + gettext("Xman - Search:"));
310 + XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
314 @@ -576,8 +587,10 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
318 - XtAppWarning(XtWidgetToApplicationContext(w),
319 - "Xman - Search: First parameter unknown.");
320 + snprintf(error_buf, sizeof(error_buf),
321 + gettext("%s First parameter unknown."),
322 + gettext("Xman - Search:"));
323 + XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
327 @@ -604,8 +617,9 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
331 - XtAppWarning(XtWidgetToApplicationContext(w),
332 - "Xman - Search: Second parameter unknown.");
333 + snprintf(error_buf, sizeof(error_buf),
334 + gettext("%s Second parameter unknown."), "Xman - Search:");
335 + XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
339 diff --git a/help.c b/help.c
340 index 2167d49..eb1a778 100644
343 @@ -35,6 +35,8 @@ from the X Consortium.
347 +#include <libintl.h>
348 +#include <X11/Xlocale.h>
350 /* Function Name: MakeHelpWidget.
351 * Description: This function creates the help widget so that it will be
352 @@ -66,7 +68,7 @@ MakeHelpWidget(void)
356 - ChangeLabel(man_globals->label, "Xman Help");
357 + ChangeLabel(man_globals->label, gettext("Xman Help"));
359 XtManageChild(man_globals->manpagewidgets.manpage);
360 XtRealizeWidget(help_widget);
361 @@ -99,7 +101,7 @@ OpenHelpfile(ManpageGlobals * man_globals)
363 if ((help_file_ptr = fopen(resources.help_file, "r")) == NULL) {
364 PopupWarning(man_globals,
365 - "Could not open help file, NO HELP WILL BE AVAILABLE.");
366 + gettext("Could not open help file, NO HELP WILL BE AVAILABLE."));
370 diff --git a/main.c b/main.c
371 index 4565a14..f75796d 100644
374 @@ -35,6 +35,8 @@ from the X Consortium.
378 +#include <libintl.h>
379 +#include <X11/Xlocale.h>
381 #include <X11/Xaw/Cardinals.h>
383 @@ -145,6 +147,7 @@ main(int argc, char **argv)
385 XtAppContext app_con;
389 saved_argv = (char **) XtMalloc(argc * sizeof(char *));
390 bcopy(argv, saved_argv, argc * sizeof(char *));
391 @@ -157,6 +160,13 @@ main(int argc, char **argv)
393 XInternAtom(XtDisplay(initial_widget), "WM_DELETE_WINDOW", False);
395 + textdomain("xman");
397 + if ((domaindir = getenv("TEXTDOMAINDIR")) == NULL) {
398 + domaindir = "/usr/X11/share/locale";
400 + bindtextdomain("xman", domaindir);
402 manglobals_context = XStringToContext(MANNAME);
404 AdjustDefResources();
405 @@ -173,10 +183,10 @@ main(int argc, char **argv)
406 XtAppAddActions(app_con, xman_actions, XtNumber(xman_actions));
408 if (!resources.fonts.directory)
409 - PrintError("Failed to get the directory font.");
410 + PrintError(gettext("Failed to get the directory font."));
413 - printf("debugging mode\n");
414 + printf(gettext("debugging mode\n"));
418 @@ -195,7 +205,7 @@ main(int argc, char **argv)
420 if ((sections = Man()) == 0)
422 - ("There are no manual sections to display, check your MANPATH.");
423 + (gettext("There are no manual sections to display, check your MANPATH."));
425 if (resources.top_box_active)
427 @@ -229,42 +239,53 @@ ArgError(int argc, char **argv)
431 - static const char **syntax, *syntax_def[] = {
432 - "-help", "Print this message",
433 - "-helpfile <filename>", "Specifies the helpfile to use.",
434 - "-bothshown", "Show both the directory and manpage at once.",
435 - "-notopbox", "Starts with manpage rather than topbox.",
436 - "-geometry <geom>", "Specifies the geometry of the top box.",
437 - "=<geom>", "Specifies the geometry of the top box.",
438 - "-pagesize <geom>", "Specifies the geometry of the manual page.",
439 - "-bw <pixels>", "Width of all window borders.",
440 - "-borderwidth <pixels>", "Width of all window borders.",
441 - "-bd <color>", "Color of all window borders.",
442 - "-bordercolor <color>", "Color of all window borders.",
443 - "-fg <color>", "Foreground color for the application.",
444 - "-foreground <color>", "Foreground color for the application.",
445 - "-bg <color>", "Background color for the application.",
446 - "-background <color>", "Background color for the application.",
447 - "-display <display name>", "Specify a display that is not the default",
448 - "-fn <font>", "Font to be used for button and label text.",
449 - "-font <font>", "Font to be used for button and label text.",
450 - "-name <name>", "Change the name used for retrieving resources.",
451 - "-title <name>", "Change the name without affecting resources.",
452 - "-xrm <resource>", "Specifies a resource on the command line.",
456 - syntax = syntax_def;
458 for (i = 1; i < argc; i++)
459 - (void) printf("This argument is unknown to Xman: %s\n", argv[i]);
461 - (void) printf("\nKnown arguments are:\n");
463 - while (*syntax != NULL) {
464 - printf("%-30s - %s\n", syntax[0], syntax[1]);
467 + (void) printf(gettext("This argument is unknown to Xman: %s\n"), argv[i]);
469 + (void) printf(gettext("\nKnown arguments are:\n"));
471 + printf("-help - %s\n",
472 + gettext("Print this message"));
473 + printf("-helpfile %s - %s\n", gettext("<filename> "),
474 + gettext("Specifies the helpfile to use."));
475 + printf("-bothshown - %s\n",
476 + gettext("Show both the directory and manpage at once."));
477 + printf("-notopbox - %s\n",
478 + gettext("Starts with manpage rather than topbox."));
479 + printf("-geometry %s - %s\n", gettext("<geom> "),
480 + gettext("Specifies the geometry of the top box."));
481 + printf("=%s - %s\n", gettext("<geom> "),
482 + gettext("Specifies the geometry of the top box."));
483 + printf("-pagesize %s - %s\n", gettext("<geom> "),
484 + gettext("Specifies the geometry of the manual page."));
485 + printf("-bw %s - %s\n", gettext("<pixels> "),
486 + gettext("Width of all window borders."));
487 + printf("-borderwidth %s - %s\n", gettext("<pixels> "),
488 + gettext("Width of all window borders."));
489 + printf("-bd %s - %s\n", gettext("<color> "),
490 + gettext("Color of all window borders."));
491 + printf("-bordercolor %s - %s\n", gettext("<color> "),
492 + gettext("Color of all window borders."));
493 + printf("-fg %s - %s\n", gettext("<color> "),
494 + gettext("Foreground color for the application."));
495 + printf("-foreground %s - %s\n", gettext("<color> "),
496 + gettext("Foreground color for the application."));
497 + printf("-bg %s - %s\n", gettext("<color> "),
498 + gettext("Background color for the application."));
499 + printf("-background %s - %s\n", gettext("<color> "),
500 + gettext("Background color for the application."));
501 + printf("-display %s - %s\n", gettext("<display name> "),
502 + gettext("Specify a display that is not the default"));
503 + printf("-fn %s - %s\n", gettext("<font> "),
504 + gettext("Font to be used for button and label text."));
505 + printf("-font %s - %s\n", gettext("<font> "),
506 + gettext("Font to be used for button and label text."));
507 + printf("-name %s - %s\n", gettext("<name> "),
508 + gettext("Change the name used for retrieving resources."));
509 + printf("-title %s - %s\n", gettext("<name> "),
510 + gettext("Change the name without affecting resources."));
511 + printf("-xrm %s - %s\n", gettext("<resource> "),
512 + gettext("Specifies a resource on the command line."));
515 /* Function Name: AdjustDefResources
516 diff --git a/man.c b/man.c
517 index e8432f0..5963a86 100644
520 @@ -31,6 +31,8 @@ from the X Consortium.
523 #include "vendor.h" /* vendor-specific defines and data */
524 +#include <libintl.h>
525 +#include <X11/Xlocale.h>
529 @@ -157,7 +159,7 @@ Man(void)
530 (sizeof(Manual) * num_alloced));
533 - ("Could not allocate memory for manual sections.");
534 + (gettext("Could not allocate memory for manual sections."));
536 InitManual(manual + sect, list->label);
537 manual[sect].flags = list->flags;
538 @@ -184,10 +186,10 @@ Man(void)
542 - PrintError("No manual pages found.");
543 + PrintError(gettext("No manual pages found."));
544 manual = (Manual *) XtRealloc((char *) manual, (sizeof(Manual) * sect));
546 - PrintError("Could not allocate memory for manual sections.");
547 + PrintError(gettext("Could not allocate memory for manual sections."));
549 return (sect); /* return the number of man sections. */
551 @@ -209,7 +211,7 @@ SortList(SectionList ** list)
552 SectionList *head, *last, *inner, *old;
555 - PrintError("No manual sections to read, exiting.");
556 + PrintError(gettext("No manual sections to read, exiting."));
560 @@ -421,7 +423,7 @@ ReadCurrentSection(Manual * local_manual, char *path)
562 if ((dir = opendir(path)) == NULL) {
564 - snprintf(error_buf, sizeof(error_buf), "Can't open directory %s", path);
565 + snprintf(error_buf, sizeof(error_buf), gettext("Can't open directory %s"), path);
566 PopupWarning(NULL, error_buf);
569 @@ -507,7 +509,7 @@ ReadCurrentSection(Manual * local_manual, char *path)
570 local_manual->entries_less_paths[nentries] =
571 strrchr(local_manual->entries[nentries], '/');
572 if (local_manual->entries_less_paths[nentries] == NULL)
573 - PrintError("Internal error while cataloging manual pages.");
574 + PrintError(gettext("Internal error while cataloging manual pages."));
578 @@ -535,7 +537,7 @@ SortAndRemove(Manual * man, int number)
582 - printf("sorting section %d - %s\n", i, man->blabel);
583 + printf(gettext("sorting section %d - %s\n"), i, man->blabel);
586 s1 = (char **) malloc(man->nentries * sizeof(char *));
587 @@ -570,13 +572,13 @@ SortAndRemove(Manual * man, int number)
588 l2 = man->entries_less_paths[j++];
591 - ("Internal error while removing duplicate manual pages.");
592 + (gettext("Internal error while removing duplicate manual pages."));
595 l2 = man->entries_less_paths[j++];
598 - ("Internal error while removing duplicate manual pages.");
599 + (gettext("Internal error while removing duplicate manual pages."));
603 @@ -931,7 +933,7 @@ DumpManual(int number)
606 for (i = 0; i < number; i++) {
607 - printf("label: %s\n", manual[i].blabel);
608 + printf("gettext(label: %s\n"), manual[i].blabel);
609 for (j = 0; j < manual[i].nentries; j++)
610 printf("%s\n", manual[i].entries[j]);
612 diff --git a/misc.c b/misc.c
613 index 33c69c7..ded2b85 100644
616 @@ -40,6 +40,8 @@ from the X Consortium.
620 +#include <libintl.h>
621 +#include <X11/Xlocale.h>
622 #include <X11/Xos.h> /* sys/types.h and unistd.h included in here */
623 #include <sys/stat.h>
625 @@ -93,7 +95,7 @@ PopupWarning(ManpageGlobals * man_globals, const char *string)
629 - snprintf(buffer, sizeof(buffer), "Xman Warning: %s", string);
630 + snprintf(buffer, sizeof(buffer), gettext("Xman Warning: %s"), string);
634 @@ -138,7 +140,7 @@ PopupWarning(ManpageGlobals * man_globals, const char *string)
636 PrintError(const char *string)
638 - fprintf(stderr, "Xman Error: %s\n", string);
639 + fprintf(stderr, gettext("Xman Error: %s\n"), string);
643 @@ -202,7 +204,7 @@ FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num)
645 temp = CreateManpageName(entry, 0, 0);
646 snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title),
647 - "The current manual page is: %s.", temp);
648 + gettext("The current manual page is: %s."), temp);
651 ParseEntry(entry, path, section, page);
652 @@ -349,8 +351,8 @@ Uncompress(ManpageGlobals * man_globals, const char *filename)
655 if (!UncompressNamed(man_globals, filename, tmp_file, &file)) {
656 - PopupWarning(man_globals, "Something went wrong in retrieving the "
657 - "uncompressed manual page try cleaning up /tmp.");
658 + PopupWarning(man_globals, gettext("Something went wrong in retrieving "
659 + "the uncompressed manual page. Try cleaning up /tmp."));
663 @@ -379,8 +381,8 @@ UncompressNamed(ManpageGlobals * man_globals, const char *filename,
664 if (stat(filename, &junk) != 0) { /* Check for existence of the file. */
665 if (errno != ENOENT) {
666 snprintf(error_buf, sizeof(error_buf),
667 - "Error while stating file %s, errno = %d", filename,
669 + gettext("Error while stating file %s, errno = %d"),
671 PopupWarning(man_globals, error_buf);
674 @@ -394,7 +396,7 @@ UncompressNamed(ManpageGlobals * man_globals, const char *filename,
675 strcpy(tmp, MANTEMP); /* get a temp file. */
678 - PopupWarning(man_globals, "Error creating a temp file");
679 + PopupWarning(man_globals, gettext("Error creating a temp file"));
682 *output_file = fdopen(fd, "r");
683 @@ -429,7 +431,7 @@ UncompressNamed(ManpageGlobals * man_globals, const char *filename,
686 snprintf(error_buf, sizeof(error_buf),
687 - "Error while uncompressing, command was: %s", cmdbuf);
688 + gettext("Error while uncompressing, command was: %s"), cmdbuf);
689 PopupWarning(man_globals, error_buf);
692 @@ -515,7 +517,7 @@ Format(ManpageGlobals * man_globals, const char *entry)
693 if (!UncompressUnformatted(man_globals, entry, filename, &file)) {
694 /* We Really could not find it, this should never happen, yea right. */
695 snprintf(error_buf, sizeof(error_buf),
696 - "Could not open manual page, %s", entry);
697 + gettext("Could not open manual page, %s"), entry);
698 PopupWarning(man_globals, error_buf);
699 XtPopdown(XtParent(man_globals->standby));
701 @@ -577,12 +579,22 @@ Format(ManpageGlobals * man_globals, const char *entry)
702 ParseEntry(entry, path, sect, NULL);
704 #ifndef HANDLE_ROFFSEQ
705 +#ifdef SFORMAT /* Handle Solaris SGML pages */
706 + if (sect[0] == 's') {
707 + snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s | %s %s >> %s %s",
708 + path, SFORMAT, filename, TBL, FORMAT, man_globals->tempfile,
711 +#endif /* SFORMAT */
712 snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s >> %s %s", path, TBL,
713 filename, FORMAT, man_globals->tempfile, "2> /dev/null");
718 /* Handle more flexible way of specifying the formatting pipeline */
719 if (!ConstructCommand(cmdbuf, path, filename, man_globals->tempfile)) {
720 - PopupWarning(man_globals, "Constructed command was too long!");
721 + PopupWarning(man_globals, gettext("Constructed command was too long!"));
725 @@ -591,7 +603,7 @@ Format(ManpageGlobals * man_globals, const char *entry)
727 if (system(cmdbuf) != 0) { /* execute search. */
728 snprintf(error_buf, sizeof(error_buf),
729 - "Something went wrong trying to run the command: %s", cmdbuf);
730 + gettext("Something went wrong trying to run the command: %s"), cmdbuf);
731 PopupWarning(man_globals, error_buf);
734 @@ -1000,7 +1012,7 @@ AddCursor(Widget w, Cursor cursor)
737 if (!XtIsRealized(w)) {
738 - PopupWarning(NULL, "Widget is not realized, no cursor added.\n");
739 + PopupWarning(NULL, gettext("Widget is not realized, no cursor added.\n"));
743 @@ -1114,14 +1126,14 @@ ParseEntry(const char *entry, char *path, char *sect, char *page)
745 c = strrchr(temp, '/');
747 - PrintError("Failed to find / in ParseEntry.");
748 + PrintError(gettext("Failed to find / in ParseEntry."));
753 c = strrchr(temp, '/');
755 - PrintError("Failed to find / in ParseEntry.");
756 + PrintError(gettext("Failed to find / in ParseEntry."));
758 #if defined(SFORMAT) && defined(SMAN)
759 /* sgmltoroff sometimes puts an extra ./ in the path to .so entries */
760 @@ -1168,12 +1180,12 @@ GetGlobals(Widget w)
763 XtAppError(XtWidgetToApplicationContext(w),
764 - "Xman: Could not locate widget in tree, exiting");
765 + gettext("Xman: Could not locate widget in tree, exiting"));
767 if (XFindContext(XtDisplay(w), XtWindow(w),
768 manglobals_context, &data) != XCSUCCESS)
769 XtAppError(XtWidgetToApplicationContext(w),
770 - "Xman: Could not find global data, exiting");
771 + gettext("Xman: Could not find global data, exiting"));
773 return ((ManpageGlobals *) data);
775 @@ -1195,7 +1207,7 @@ SaveGlobals(Widget w, ManpageGlobals * globals)
776 if (XSaveContext(XtDisplay(w), XtWindow(w), manglobals_context,
777 (caddr_t) globals) != XCSUCCESS)
778 XtAppError(XtWidgetToApplicationContext(w),
779 - "Xman: Could not save global data, are you out of memory?");
780 + gettext("Xman: Could not save global data, are you out of memory?"));
783 /* Function Name: RemoveGlobals
784 @@ -1213,5 +1225,5 @@ RemoveGlobals(Widget w)
785 if (XDeleteContext(XtDisplay(w), XtWindow(w),
786 manglobals_context) != XCSUCCESS)
787 XtAppError(XtWidgetToApplicationContext(w),
788 - "Xman: Could not remove global data?");
789 + gettext("Xman: Could not remove global data?"));