* man2hlp.c (handle_command): Handle '.\"TOPICS' comment.

Use it for translated 'Topics:' message.
* gindex.pl: Use first line of man2hlp output as
translated 'Topics:' message if fourth argument
is empty string.
* Makefile.am (mc.hlp.ru): Use empty string as gindex.pl's
fourth argument.
This commit is contained in:
Andrew V. Samoilov 2002-03-20 14:03:55 +00:00
parent e212629436
commit 830c9ae976
4 changed files with 26 additions and 1 deletions

View File

@ -1,5 +1,13 @@
2002-03-20 Andrew V. Samoilov <kai@cmail.ru>
* man2hlp.c (handle_command): Handle '.\"TOPICS' comment.
Use it for translated 'Topics:' message.
* gindex.pl: Use first line of man2hlp output as
translated 'Topics:' message if fourth argument
is empty string.
* Makefile.am (mc.hlp.ru): Use empty string as gindex.pl's
fourth argument.
* textconf.c (version): Write to stdout.
* main.c (print_mc_usage): Add "stream" parameter to specify
file stream.

View File

@ -75,7 +75,7 @@ $(srcdir)/mc.hlp: $(top_srcdir)/doc/mc.1 $(top_srcdir)/lib/xnc.hlp $(srcdir)/gin
$(srcdir)/mc.hlp.ru: $(top_srcdir)/doc/ru/mc.1 $(top_srcdir)/doc/ru/xnc.hlp $(srcdir)/gindex.pl man2hlp
- perl $(srcdir)/gindex.pl $(top_srcdir)/doc/ru/mc.1 \
$(top_srcdir)/doc/ru/xnc.hlp $(srcdir)/mc.hlp.ru 'ňÁÚÄĹĚŮ ĐĎÍĎÝÉ:'
$(top_srcdir)/doc/ru/xnc.hlp $(srcdir)/mc.hlp.ru ''
install-exec-hook:
$(MAKE) install_mcview

View File

@ -26,6 +26,11 @@ open (HELP2, "< $tmpl_file") or die "Cannot open $tmpl_file: $!\n";
push @help_file, <HELP2>;
close (HELP2);
if ($Topics eq ''){
$Topics = shift (@help_file);
chomp ($Topics);
}
foreach $line (@help_file){
if ($line =~ /\x04\[(.*)\]/ && $line !~ /\x04\[main\]/){
if (length $1) {

View File

@ -267,6 +267,18 @@ static void handle_command (char *buffer)
if (col > 0) newline ();
newline ();
}
else if (strcmp (buffer, ".\\\"TOPICS") == 0){
if (out_row > 1){
print_error ("Syntax error: .\\\"TOPICS must be first command");
return;
}
buffer = strtok (NULL, "");
if (buffer == NULL){
print_error ("Syntax error: .\\\"TOPICS: no text");
return;
}
printf ("%s\n", buffer);
}
else {
/* Other commands are ignored */
}