[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8045] do not call gettext as a method on a parser object
From: |
gavinsmith0123 |
Subject: |
[8045] do not call gettext as a method on a parser object |
Date: |
Sun, 12 Aug 2018 15:01:17 -0400 (EDT) |
Revision: 8045
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8045
Author: gavin
Date: 2018-08-12 15:01:17 -0400 (Sun, 12 Aug 2018)
Log Message:
-----------
do not call gettext as a method on a parser object
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Common.pm
trunk/tp/Texinfo/Convert/Converter.pm
trunk/tp/Texinfo/Convert/DocBook.pm
trunk/tp/Texinfo/Convert/HTML.pm
trunk/tp/Texinfo/Convert/IXIN.pm
trunk/tp/Texinfo/Convert/Info.pm
trunk/tp/Texinfo/Convert/Plaintext.pm
trunk/tp/Texinfo/Convert/TexinfoXML.pm
trunk/tp/Texinfo/Parser.pm
trunk/tp/Texinfo/Report.pm
trunk/tp/Texinfo/Structuring.pm
trunk/tp/t/test_utils.pl
trunk/tp/texi2any.pl
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/ChangeLog 2018-08-12 19:01:17 UTC (rev 8045)
@@ -1,3 +1,38 @@
+2018-08-12 Gavin Smith <address@hidden>
+
+ * tp/Texinfo/Common.pm (__, __p): Copy functions from
+ texi2any.pl. Place these in @EXPORT.
+ (%default_parser_state_configuration): Refer to __ and __p
+ for 'gettext' and 'pgettext' instead of stub functions.
+ * t/test_utils.pl: Call Locale::Messages::bindtextdomain for
+ 'texinfo' domain as well as 'texinfo_document'.
+ * tp/texi2any.pl (__, __p): Remove definitions.
+
+ * tp/Texinfo/Report.pm (__, __p): Do not take a first argument
+ that is a parser object. Do not look at 'gettext' and
+ 'pgettext' configuration values: call the functions in
+ Locale::Messages directly.
+
+ * tp/Texinfo/Common.pm,
+ * tp/Texinfo/Structuring.pm,
+ * tp/Texinfo/Parser.pm,
+ * tp/Texinfo/Convert/Converter.pm,
+ * tp/Texinfo/Convert/Docbook.pm,
+ * tp/Texinfo/Convert/HTML.pm,
+ * tp/Texinfo/Convert/IXIN.pm,
+ * tp/Texinfo/Convert/Info.pm,
+ * tp/Texinfo/Convert/Plaintext.pm,
+ * tp/Texinfo/Convert/TexinfoXML.pm:
+ Do not call __ or __p as methods on a parser object: use the
+ functions exported from Common.pm instead.
+
+ The only effect of this change should be in the test suite where
+ the default stub values for 'gettext' and 'pgettext' were used
+ for Texinfo. This should have no user-visible effect. The name
+ of the translation domain ("texinfo") is no longer set from the
+ name of the package in texi2any.pl, but this was already
+ hard-coded in Texinfo/Report.pm.
+
2018-08-10 Gavin Smith <address@hidden>
* tp/t/test_utils.pl (test): Avoid method call syntax for
Modified: trunk/tp/Texinfo/Common.pm
===================================================================
--- trunk/tp/Texinfo/Common.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Common.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -69,6 +69,7 @@
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@EXPORT = qw(
+__ __p
);
$VERSION = '6.5dev';
@@ -90,6 +91,21 @@
$null_device_file{'NUL'} = 1;
}
+use Locale::Messages;
+
+my $messages_textdomain = 'texinfo';
+
+sub __($) {
+ my $msgid = shift;
+ return Locale::Messages::dgettext($messages_textdomain, $msgid);
+}
+
+sub __p($$) {
+ my $context = shift;
+ my $msgid = shift;
+ return Locale::Messages::dpgettext($messages_textdomain, $context, $msgid);
+}
+
# these are the default values for the parser state that may be
# initialized to values given by the user.
# They are defined here, because they are used below and we
@@ -96,8 +112,8 @@
# don't want Texinfo::Common to use Texinfo::Parser.
our %default_parser_state_configuration = (
'expanded_formats' => [],
- 'gettext' => sub {return $_[0];},
- 'pgettext' => sub {return $_[1];},
+ 'gettext' => \&__,
+ 'pgettext' => \&__p,
'include_directories' => [ '.' ],
# these are the user-added indices. May be an array reference on names
# or an hash reference in the same format than %index_names below
@@ -1135,7 +1151,7 @@
if (defined($file)) {
if (!open(VERBINCLUDE, $file)) {
if ($self) {
- $self->line_error(sprintf($self->__("could not read %s: %s"), $file,
$!),
+ $self->line_error(sprintf(__("could not read %s: %s"), $file, $!),
$current->{'line_nr'});
}
} else {
@@ -1154,7 +1170,7 @@
}
if (!close (VERBINCLUDE)) {
if ($self) {
- $self->document_warn(sprintf($self->__(
+ $self->document_warn(sprintf(__(
"error on closing address@hidden file %s: %s"),
$file, $!));
}
@@ -1161,7 +1177,7 @@
}
}
} elsif ($self) {
- $self->line_error(sprintf($self->__("address@hidden: could not find %s"),
+ $self->line_error(sprintf(__("address@hidden: could not find %s"),
$current->{'cmdname'}, $text), $current->{'line_nr'});
}
return $verbatiminclude;
@@ -1626,7 +1642,7 @@
$renamed_nodes_lines->{$_} = $renamed_nodes_line_nr;
@old_names = ();
} else {
- $self->file_line_warn($self->__("no node to be renamed"),
+ $self->file_line_warn(__("no node to be renamed"),
$renamed_nodes_file, $renamed_nodes_line_nr);
}
} else {
@@ -1637,17 +1653,17 @@
}
}
if (scalar(@old_names)) {
- $self->file_line_warn($self->__("nodes without a new name at the end of
file"),
+ $self->file_line_warn(__("nodes without a new name at the end of file"),
$renamed_nodes_file, $renamed_nodes_line_nr);
}
if (!close(RENAMEDFILE)) {
- $self->document_warn(sprintf($self->__p(
+ $self->document_warn(sprintf(__p(
"see HTML Xref Link Preservation in the Texinfo manual for context",
"error on closing node-renaming configuration file %s: %s"),
$renamed_nodes_file, $!));
}
} else {
- $self->document_warn(sprintf($self->__("could not open %s: %s"),
+ $self->document_warn(sprintf(__("could not open %s: %s"),
$renamed_nodes_file, $!));
}
return ($renamed_nodes, $renamed_nodes_lines);
@@ -2166,7 +2182,7 @@
my $parent = $current->{'parent'};
while ($parent) {
if ($parent->{'cmdname'} and $parent->{'line_nr'}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"could not protect hash character in address@hidden"),
$parent->{'cmdname'}), $parent->{'line_nr'});
last;
Modified: trunk/tp/Texinfo/Convert/Converter.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Converter.pm 2018-08-10 18:37:08 UTC (rev
8044)
+++ trunk/tp/Texinfo/Convert/Converter.pm 2018-08-12 19:01:17 UTC (rev
8045)
@@ -785,7 +785,7 @@
or $self->get_conf('OUTFILE') eq '-'
or $self->get_conf('OUTFILE') eq '')) {
if ($self->get_conf('SPLIT')) {
- $self->document_warn(sprintf($self->__("%s: output incompatible with
split"),
+ $self->document_warn(sprintf(__("%s: output incompatible with split"),
$self->get_conf('OUTFILE')));
$self->force_conf('SPLIT', 0);
}
@@ -846,7 +846,7 @@
if ($self->get_conf('DEBUG'));
$fh = $self->Texinfo::Common::open_out($outfile);
if (!$fh) {
- $self->document_error(sprintf($self->__("could not open %s for
writing: %s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$outfile, $!));
return undef;
}
@@ -867,7 +867,7 @@
if ($fh and $outfile ne '-') {
$self->register_close_file($outfile);
if (!close($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$outfile, $!));
}
}
@@ -884,7 +884,7 @@
if (!$files{$element->{'filename'}}->{'fh'}) {
$file_fh =
$self->Texinfo::Common::open_out($element->{'out_filename'});
if (!$file_fh) {
- $self->document_error(sprintf($self->__("could not open %s for
writing: %s"),
+ $self->document_error(sprintf(__("could not open %s for writing:
%s"),
$element->{'out_filename'}, $!));
return undef;
}
@@ -900,7 +900,7 @@
if ($element->{'out_filename'} ne '-') {
$self->register_close_file($element->{'out_filename'});
if (!close($file_fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$element->{'out_filename'}, $!));
return undef;
}
@@ -977,7 +977,7 @@
$directories . '.' . $self->get_conf('EXTENSION'), $file);
if (! -d $new_directory) {
if (!mkdir($new_directory, oct(755))) {
- $self->document_error(sprintf($self->__(
+ $self->document_error(sprintf(__(
"could not create directories `%s' or `%s': %s"),
$self->{'destination_directory'}, $new_directory, $!));
return undef;
@@ -985,7 +985,7 @@
}
$self->{'destination_directory'} = $new_directory;
} else {
- $self->document_error(sprintf($self->__(
+ $self->document_error(sprintf(__(
"could not create directory `%s': %s"),
$self->{'destination_directory'}, $!));
return undef;
@@ -1214,7 +1214,7 @@
if (! $self->{'output_file'} eq '') {
$fh = $self->Texinfo::Common::open_out($self->{'output_file'});
if (!$fh) {
- $self->document_error(sprintf($self->__("could not open %s for writing:
%s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$self->{'output_file'}, $!));
return undef;
}
Modified: trunk/tp/Texinfo/Convert/DocBook.pm
===================================================================
--- trunk/tp/Texinfo/Convert/DocBook.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Convert/DocBook.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -323,7 +323,7 @@
if (! $self->{'output_file'} eq '') {
$fh = $self->Texinfo::Common::open_out ($self->{'output_file'});
if (!$fh) {
- $self->document_error(sprintf($self->__("could not open %s for writing:
%s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$self->{'output_file'}, $!));
return undef;
}
@@ -359,7 +359,7 @@
if ($fh and $self->{'output_file'} ne '-') {
$self->register_close_file($self->{'output_file'});
if (!close ($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}, $!));
}
}
@@ -981,7 +981,7 @@
}
if (!defined($image_text) and !$image_file_found) {
$self->line_warn(sprintf(
- $self->__("address@hidden file `%s' not found, using
`%s'"),
+ __("address@hidden file `%s' not found, using `%s'"),
$basefile, "$basefile.jpg"), $root->{'line_nr'});
}
@@ -1101,7 +1101,7 @@
if ($argument) {
$result = "&#x$argument;";
} else {
- $self->line_warn($self->__("no argument specified for
address@hidden"),
+ $self->line_warn(__("no argument specified for address@hidden"),
$root->{'line_nr'});
$result = '';
}
Modified: trunk/tp/Texinfo/Convert/HTML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/HTML.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Convert/HTML.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -1732,7 +1732,7 @@
}
#cluck "err ($self->{'ignore_notice'})";
$self->line_warn(sprintf(
- $self->__("address@hidden file `%s' (for HTML) not found, using
`%s'"),
+ __("address@hidden file `%s' (for HTML) not found, using `%s'"),
$basefile, $image_file), $command->{'line_nr'});
}
if (defined($self->get_conf('IMAGE_LINK_PREFIX'))) {
@@ -2435,7 +2435,7 @@
if ($cmdname eq $self->{'output_format'}) {
return $content;
}
- $self->line_warn(sprintf($self->__("raw format %s is not converted"),
+ $self->line_warn(sprintf(__("raw format %s is not converted"),
$cmdname), $command->{'line_nr'});
return $self->protect_text($content);
}
@@ -4678,7 +4678,7 @@
print STDERR "html refs config file: $file\n" if
($self->get_conf('DEBUG'));
unless (open (HTMLXREF, $file)) {
$self->document_warn(
- sprintf($self->__("could not open html refs config file %s: %s"),
+ sprintf(__("could not open html refs config file %s: %s"),
$file, $!));
next;
}
@@ -4706,10 +4706,10 @@
my $split_or_mono = shift @htmlxref;
#print STDERR "$split_or_mono
$Texi2HTML::Config::htmlxref_entries{$split_or_mono} $line_nr\n";
if (!defined($split_or_mono)) {
- $self->file_line_warn($self->__("missing type"), $file, $line_nr);
+ $self->file_line_warn(__("missing type"), $file, $line_nr);
next;
} elsif (!defined($htmlxref_entries{$split_or_mono})) {
- $self->file_line_warn(sprintf($self->__("unrecognized type: %s"),
+ $self->file_line_warn(sprintf(__("unrecognized type: %s"),
$split_or_mono), $file, $line_nr);
next;
}
@@ -4725,7 +4725,7 @@
$htmlxref->{$manual}->{$split_or_mono} = $href;
}
if (!close (HTMLXREF)) {
- $self->document_warn(sprintf($self->__(
+ $self->document_warn(sprintf(__(
"error on closing html refs config file %s: %s"),
$file, $!));
}
@@ -5011,11 +5011,11 @@
#file_line_warn (__("string not closed in css file"), $file) if ($in_string);
#file_line_warn (__("--css-file ended in comment"), $file) if ($in_comment);
#file_line_warn (__("address@hidden not finished in css file"), $file) if
($in_import and !$in_comment and !$in_string);
- $self->file_line_warn(sprintf($self->__("string not closed in css file"),
+ $self->file_line_warn(sprintf(__("string not closed in css file"),
$file, $line_nr)) if ($in_string);
- $self->file_line_warn(sprintf($self->__("--css-include ended in comment"),
+ $self->file_line_warn(sprintf(__("--css-include ended in comment"),
$file, $line_nr)) if ($in_comment);
- $self->file_line_warn(sprintf($self->__("address@hidden not finished in css
file"),
+ $self->file_line_warn(sprintf(__("address@hidden not finished in css file"),
$file, $line_nr))
if ($in_import and !$in_comment and !$in_string);
return ($imports, $rules);
@@ -5041,12 +5041,12 @@
$css_file = $self->Texinfo::Common::locate_include_file($file);
unless (defined($css_file)) {
$self->document_warn(sprintf(
- $self->__("CSS file %s not found"), $file));
+ __("CSS file %s not found"), $file));
next;
}
# FIXME use open_out?
unless (open (CSSFILE, $css_file)) {
- $self->document_warn(sprintf($self->__(
+ $self->document_warn(sprintf(__(
"could not open --include-file %s: %s"),
$css_file, $!));
next;
@@ -5057,7 +5057,7 @@
($import_lines, $rules_lines)
= $self->_process_css_file ($css_file_fh, $css_file);
if (!close($css_file_fh)) {
- $self->document_warn(sprintf($self->__("error on closing CSS file %s:
%s"),
+ $self->document_warn(sprintf(__("error on closing CSS file %s: %s"),
$css_file, $!));
}
push @css_import_lines, @$import_lines;
@@ -5870,11 +5870,11 @@
if ($self->get_conf('CHECK_HTMLXREF')
and !$external_node->{'top_node_up'}) {
if (defined($link_command) and $link_command->{'line_nr'}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"no htmlxref.cnf entry found for `%s'"), $manual_name),
$link_command->{'line_nr'});
} elsif (!$self->{'check_htmlxref_already_warned'}->{$manual_name}) {
- $self->document_warn(sprintf($self->__(
+ $self->document_warn(sprintf(__(
"no htmlxref.cnf entry found for `%s'"), $manual_name),
);
}
@@ -6568,12 +6568,12 @@
$self->register_close_file($frame_outfile);
if (!close ($frame_fh)) {
- $self->document_error(sprintf($self->__("error on closing frame file %s:
%s"),
+ $self->document_error(sprintf(__("error on closing frame file %s: %s"),
$frame_outfile, $!));
return 0;
}
} else {
- $self->document_error(sprintf($self->__("could not open %s for writing:
%s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$frame_outfile, $!));
return 0;
}
@@ -6592,12 +6592,12 @@
$self->register_close_file($toc_frame_outfile);
if (!close ($toc_frame_fh)) {
- $self->document_error(sprintf($self->__("error on closing TOC frame file
%s: %s"),
+ $self->document_error(sprintf(__("error on closing TOC frame file %s:
%s"),
$toc_frame_outfile, $!));
return 0;
}
} else {
- $self->document_error(sprintf($self->__("could not open %s for writing:
%s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$toc_frame_outfile, $!));
return 0;
}
@@ -6911,7 +6911,7 @@
$self->{'title_string'} = $self->convert_tree_new_formatting_context(
{'type' => '_string', 'contents' => [$self->{'title_tree'}]},
'title_string');
- $self->file_line_warn($self->__(
+ $self->file_line_warn(__(
"must specify a title with a title command or
address@hidden"),
$self->{'info'}->{'input_file_name'});
} else {
@@ -6978,7 +6978,7 @@
if ($self->get_conf('DEBUG'));
$fh = $self->Texinfo::Common::open_out($outfile);
if (!$fh) {
- $self->document_error(sprintf($self->__("could not open %s for
writing: %s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$outfile, $!));
return undef;
}
@@ -7004,7 +7004,7 @@
if ($fh and $outfile ne '-') {
$self->register_close_file($outfile);
if (!close($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$outfile, $!));
}
}
@@ -7037,7 +7037,7 @@
if (!$files{$element->{'filename'}}->{'fh'}) {
$file_fh =
$self->Texinfo::Common::open_out($element->{'out_filename'});
if (!$file_fh) {
- $self->document_error(sprintf($self->__("could not open %s for
writing: %s"),
+ $self->document_error(sprintf(__("could not open %s for writing:
%s"),
$element->{'out_filename'}, $!));
return undef;
}
@@ -7063,7 +7063,7 @@
if ($element->{'out_filename'} ne '-') {
$self->register_close_file($element->{'out_filename'});
if (!close($file_fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$element->{'out_filename'}, $!));
return undef;
}
@@ -7115,7 +7115,7 @@
}
my $file_fh = $self->Texinfo::Common::open_out($out_filename);
if (!$file_fh) {
- $self->document_error(sprintf($self->__(
+ $self->document_error(sprintf(__(
"could not open %s for writing: %s"),
$out_filename, $!));
} else {
@@ -7122,7 +7122,7 @@
print $file_fh $redirection_page;
$self->register_close_file($out_filename);
if (!close ($file_fh)) {
- $self->document_error(sprintf($self->__(
+ $self->document_error(sprintf(__(
"error on closing redirection node file %s: %s"),
$out_filename, $!));
return undef;
@@ -7147,13 +7147,13 @@
$self->{'renamed_nodes_file'});
if ($parsed_old_node) {
if ($self->label_command($parsed_old_node->{'normalized'})) {
- $self->file_line_error(sprintf($self->__(
+ $self->file_line_error(sprintf(__(
"old name for `%s' is a node of the document"), $old_node_name),
$self->{'renamed_nodes_file'},
$self->{'renamed_nodes_lines'}->{$old_node_name});
$parsed_old_node = undef;
} elsif ($parsed_old_node->{'normalized'} !~ /[^-]/) {
- $self->file_line_error(sprintf($self->__(
+ $self->file_line_error(sprintf(__(
"file empty for renamed node `%s'"), $old_node_name),
$self->{'renamed_nodes_file'},
$self->{'renamed_nodes_lines'}->{$old_node_name});
@@ -7167,7 +7167,7 @@
$self->{'renamed_nodes_file'});
if (!$self->label_command($parsed_new_node->{'normalized'})) {
if (!$warned_new_node{$new_node_name}) {
- $self->file_line_warn(sprintf($self->__(
+ $self->file_line_warn(sprintf(__(
"target node (new name for `%s') not in document: %s"),
$old_node_name, $new_node_name), $self->{'renamed_nodes_file'},
$self->{'renamed_nodes_lines'}->{$new_node_name});
@@ -7193,13 +7193,13 @@
}
my $file_fh = $self->Texinfo::Common::open_out($out_filename);
if (!$file_fh) {
- $self->document_error(sprintf($self->__("could not open %s for
writing: %s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$out_filename, $!));
} else {
print $file_fh $redirection_page;
$self->register_close_file($out_filename);
if (!close ($file_fh)) {
- $self->document_error(sprintf($self->__(
+ $self->document_error(sprintf(__(
"error on closing renamed node redirection file %s: %s"),
$out_filename, $!));
return undef;
@@ -7238,9 +7238,9 @@
$node_tree);
my $line_nr = {'line_nr' => $line_number, 'file_name' => $file };
if (!$node_normalized_result) {
- $self->line_warn($self->__('empty node name'), $line_nr);
+ $self->line_warn(__('empty node name'), $line_nr);
} elsif ($node_normalized_result->{'manual_content'}) {
- $self->line_error(sprintf($self->__("syntax for an external node used
for `%s'"),
+ $self->line_error(sprintf(__("syntax for an external node used for
`%s'"),
$node_texi), $line_nr);
} else {
Modified: trunk/tp/Texinfo/Convert/IXIN.pm
===================================================================
--- trunk/tp/Texinfo/Convert/IXIN.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Convert/IXIN.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -290,7 +290,7 @@
if (! $self->{'output_file'} eq '') {
$fh = $self->Texinfo::Common::open_out($self->{'output_file'});
if (!$fh) {
- $self->document_error(sprintf($self->__("could not open %s for writing:
%s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$self->{'output_file'}, $!));
return undef;
}
@@ -913,7 +913,7 @@
if ($fh and $self->{'output_file'} ne '-') {
$self->register_close_file($self->{'output_file'});
if (!close ($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}, $!));
}
}
Modified: trunk/tp/Texinfo/Convert/Info.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Info.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Convert/Info.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -23,6 +23,7 @@
use 5.00405;
use strict;
+use Texinfo::Common;
use Texinfo::Convert::Plaintext;
use Texinfo::Convert::Text;
@@ -107,7 +108,7 @@
my $out_file_nr = 0;
my @indirect_files;
if (!defined($elements) or $elements->[0]->{'extra'}->{'no_node'}) {
- $self->file_line_warn($self->__("document without nodes"),
+ $self->file_line_warn(__("document without nodes"),
$self->{'info'}->{'input_file_name'});
my $output = $header.$self->_convert($root);
$self->_count_context_bug_message('no element ');
@@ -124,7 +125,7 @@
} else {
unless ($self->{'structuring'} and $self->{'structuring'}->{'top_node'}
and $self->{'structuring'}->{'top_node'}->{'extra'}->{'normalized'} eq
'Top') {
- $self->file_line_warn($self->__("document without Top node"),
+ $self->file_line_warn(__("document without Top node"),
$self->{'info'}->{'input_file_name'});
}
$out_file_nr = 1;
@@ -162,7 +163,7 @@
if ($out_file_nr == 1) {
$self->register_close_file($self->{'output_file'});
if (defined($close_error)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}, $close_error));
return undef;
}
@@ -172,7 +173,7 @@
}
unless (rename($self->{'output_file'},
$self->{'output_file'}.'-'.$out_file_nr)) {
- $self->document_error(sprintf($self->__("rename %s failed: %s"),
+ $self->document_error(sprintf(__("rename %s failed: %s"),
$self->{'output_file'}, $!));
return undef;
}
@@ -188,7 +189,7 @@
} else {
$self->register_close_file($self->{'output_file'}.'-'.$out_file_nr);
if (defined($close_error)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}.'-'.$out_file_nr,
$close_error));
return undef;
@@ -216,7 +217,7 @@
if ($out_file_nr > 1) {
$self->register_close_file($self->{'output_file'}.'-'.$out_file_nr);
if (!close ($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}.'-'.$out_file_nr, $!));
return undef;
}
@@ -253,7 +254,7 @@
my ($label_text, $byte_count) = $self->_node_line($label->{'root'});
if ($seen_anchors{$label_text}) {
- $self->line_error(sprintf($self->__("address@hidden output more than
once: %s"),
+ $self->line_error(sprintf(__("address@hidden output more than once: %s"),
$label->{'root'}->{'cmdname'},
Texinfo::Convert::Texinfo::convert({'contents' =>
$label->{'root'}->{'extra'}->{'node_content'}})),
@@ -279,7 +280,7 @@
unless ($self->{'output_file'} eq '-') {
$self->register_close_file($self->{'output_file'});
if (!close ($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}, $!));
}
}
@@ -299,7 +300,7 @@
my $fh = $self->Texinfo::Common::open_out($filename, undef, 'use_binmode');
if (!$fh) {
$self->document_error(sprintf(
- $self->__("could not open %s for writing: %s"),
+ __("could not open %s for writing: %s"),
$filename, $!));
return undef;
}
@@ -383,7 +384,7 @@
my $self = shift;
my $root = shift;
if (!$self->{'node'}) {
- $self->line_warn(sprintf($self->__("address@hidden outside of any node"),
+ $self->line_warn(sprintf(__("address@hidden outside of any node"),
$root->{'cmdname'}), $root->{'line_nr'});
}
}
@@ -425,7 +426,7 @@
my $post_quote = '';
if ($node_text =~ /,/) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden name should not contain `,': %s"),
$node_text),
$node->{'line_nr'});
}
Modified: trunk/tp/Texinfo/Convert/Plaintext.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Plaintext.pm 2018-08-10 18:37:08 UTC (rev
8044)
+++ trunk/tp/Texinfo/Convert/Plaintext.pm 2018-08-12 19:01:17 UTC (rev
8045)
@@ -1249,7 +1249,7 @@
next if ($entry_text !~ /\S/);
# FIXME protect instead
if ($entry_text =~ /:/ and $self->get_conf('INDEX_SPECIAL_CHARS_WARNING'))
{
- $self->line_warn (sprintf($self->__("Index entry in address@hidden with
: produces invalid Info: %s"),
+ $self->line_warn (sprintf(__("Index entry in address@hidden with :
produces invalid Info: %s"),
$entry->{'index_at_command'},
Texinfo::Convert::Texinfo::convert($entry_tree)),
$entry->{'command'}->{'line_nr'});
@@ -1296,7 +1296,7 @@
# done by the Parser.
# Warn, only once.
if (!$self->{'index_entries_no_node'}->{$entry}) {
- $self->line_warn(sprintf($self->__("entry for index `%s' outside of
any node"),
+ $self->line_warn(sprintf(__("entry for index `%s' outside of any
node"),
$index_name),
$entry->{'command'}->{'line_nr'});
$self->{'index_entries_no_node'}->{$entry} = 1;
}
@@ -1408,12 +1408,12 @@
# remove last end of line
chomp ($result);
if (!close ($filehandle)) {
- $self->document_warn(sprintf($self->__("error on closing image text
file %s: %s"),
+ $self->document_warn(sprintf(__("error on closing image text file %s:
%s"),
$txt_file, $!));
}
return ($result, $max_width);
} else {
- $self->line_warn(sprintf($self->__("address@hidden file `%s' unreadable:
%s"),
+ $self->line_warn(sprintf(__("address@hidden file `%s' unreadable: %s"),
$txt_file, $!), $root->{'line_nr'});
}
}
@@ -1433,7 +1433,7 @@
{'contents' => $root->{'args'}->[3]->{'contents'}},
$self->{'convert_text_options'}) .']';
} else {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"could not find address@hidden file `%s.txt' nor alternate
text"),
$basefile), $root->{'line_nr'});
$result = '['.$basefile.']';
@@ -1793,7 +1793,7 @@
and $root->{'args'}->[0]->{'contents'}->[0]->{'text'} =~
/^Note\s/i
and $self->{'output_format'}
and $self->{'output_format'} eq 'info') {
- $self->line_warn($self->__(
+ $self->line_warn(__(
"address@hidden produces a spurious cross-reference in Info; reword to
avoid that"),
$root->{'line_nr'});
}
@@ -2041,7 +2041,7 @@
my $quoting_required = 0;
if ($name_text_checked =~ /:/m) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden cross-reference name should not contain
`:'"),
$command), $root->{'line_nr'});
}
@@ -2079,7 +2079,7 @@
$quoting_required = 0;
if ($node_text_checked =~ /([,\t\.])/m ) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden node name should not contain `%s'"),
$command, $1),
$root->{'line_nr'});
}
@@ -2112,7 +2112,7 @@
my $quoting_required = 0;
if ($node_text_checked =~ /:/m) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden node name should not contain `:'"), $command),
$root->{'line_nr'});
}
@@ -2158,11 +2158,11 @@
my $text = $next->{'text'};
$text =~ s/^\s*//;
my $char = substr($text, 0, 1);
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"`.' or `,' must follow address@hidden, not %s"),
$char), $root->{'line_nr'});
} else {
- $self->line_warn($self->__("`.' or `,' must follow
address@hidden"),
+ $self->line_warn(__("`.' or `,' must follow address@hidden"),
$root->{'line_nr'});
}
}
@@ -2951,7 +2951,7 @@
if ($entry_name_seen) {
if ($node_text =~ /([,\t]|\.\s)/) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"menu entry node name should not contain `%s'"), $1),
$root->{'line_nr'});
}
@@ -2962,7 +2962,7 @@
} else {
if ($node_text =~ /:/) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn($self->__(
+ $self->line_warn(__(
"menu entry node name should not contain `:'"),
$root->{'line_nr'});
}
@@ -2982,7 +2982,7 @@
$pre_quote = $post_quote = '';
if ($entry_name =~ /:/) {
if ($self->get_conf('INFO_SPECIAL_CHARS_WARNING')) {
- $self->line_warn($self->__(
+ $self->line_warn(__(
"menu entry name should not contain `:'"),
$root->{'line_nr'});
}
Modified: trunk/tp/Texinfo/Convert/TexinfoXML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/TexinfoXML.pm 2018-08-10 18:37:08 UTC (rev
8044)
+++ trunk/tp/Texinfo/Convert/TexinfoXML.pm 2018-08-12 19:01:17 UTC (rev
8045)
@@ -453,7 +453,7 @@
if (! $self->{'output_file'} eq '') {
$fh = $self->Texinfo::Common::open_out($self->{'output_file'});
if (!$fh) {
- $self->document_error(sprintf($self->__("could not open %s for writing:
%s"),
+ $self->document_error(sprintf(__("could not open %s for writing: %s"),
$self->{'output_file'}, $!));
return undef;
}
@@ -472,7 +472,7 @@
if ($fh and $self->{'output_file'} ne '-') {
$self->register_close_file($self->{'output_file'});
if (!close ($fh)) {
- $self->document_error(sprintf($self->__("error on closing %s: %s"),
+ $self->document_error(sprintf(__("error on closing %s: %s"),
$self->{'output_file'}, $!));
}
}
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Parser.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -856,7 +856,7 @@
my $filehandle = do { local *FH };
if (! open($filehandle, $file_name)) {
- $self->document_error(sprintf($self->__("could not open %s: %s"),
+ $self->document_error(sprintf(__("could not open %s: %s"),
$file_name, $!));
return undef;
}
@@ -1011,7 +1011,7 @@
my $normalized =
Texinfo::Convert::NodeNameNormalization::normalize_node({'contents' =>
$target->{'extra'}->{'node_content'}});
if ($normalized !~ /[^-]/) {
- $self->line_error (sprintf($self->__("empty node name after
expansion `%s'"),
+ $self->line_error (sprintf(__("empty node name after expansion
`%s'"),
Texinfo::Convert::Texinfo::convert({'contents'
=> $target->{'extra'}->{'node_content'}})),
$target->{'line_nr'});
@@ -1019,13 +1019,13 @@
} else {
if (defined $labels{$normalized}) {
$self->line_error(
- sprintf($self->__("address@hidden `%s' previously defined"),
+ sprintf(__("address@hidden `%s' previously defined"),
$target->{'cmdname'},
Texinfo::Convert::Texinfo::convert({'contents' =>
$target->{'extra'}->{'node_content'}})),
$target->{'line_nr'});
$self->line_error(
- sprintf($self->__("here is the previous definition as
address@hidden"),
+ sprintf(__("here is the previous definition as address@hidden"),
$labels{$normalized}->{'cmdname'}),
$labels{$normalized}->{'line_nr'});
delete $target->{'extra'}->{'node_content'};
@@ -1044,7 +1044,7 @@
}
} else {
if ($target->{'cmdname'} eq 'node') {
- $self->line_error (sprintf($self->__("empty argument in
address@hidden"),
+ $self->line_error (sprintf(__("empty argument in address@hidden"),
$target->{'cmdname'}), $target->{'line_nr'});
delete $target->{'extra'}->{'node_content'};
}
@@ -1135,7 +1135,7 @@
if ($command eq 'setfilename'
and scalar(@{$self->{'input'}}) > 1) {
} elsif (exists ($self->{'extra'}->{$current->{'cmdname'}})) {
- $self->line_warn(sprintf($self->__('multiple @%s'),
+ $self->line_warn(sprintf(__('multiple @%s'),
$current->{'cmdname'}), $line_nr);
} else {
$self->{'extra'}->{$current->{'cmdname'}} = $current;
@@ -1173,7 +1173,7 @@
{ 'type' => 'macro_arg', 'text' => $formal_arg,
'parent' => $macro};
if ($formal_arg !~ /^[\w\-]+$/) {
- $self->line_error(sprintf($self->__("bad or empty address@hidden
formal argument: %s"),
+ $self->line_error(sprintf(__("bad or empty address@hidden formal
argument: %s"),
$command, $formal_arg), $line_nr);
$macro->{'extra'}->{'invalid_syntax'} = 1;
}
@@ -1183,17 +1183,17 @@
# accept an @-command after the arguments in case there is a @c or
# @comment
if ($args_def =~ /address@hidden/) {
- $self->line_error(sprintf($self->__("bad syntax for address@hidden
argument: %s"),
+ $self->line_error(sprintf(__("bad syntax for address@hidden argument:
%s"),
$command, $args_def),
$line_nr);
$macro->{'extra'}->{'invalid_syntax'} = 1;
}
} elsif ($line !~ /\S/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s requires a name"), ord('@'), $command), $line_nr);
$macro->{'extra'}->{'invalid_syntax'} = 1;
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad name for address@hidden"), $command), $line_nr);
$macro->{'extra'}->{'invalid_syntax'} = 1;
}
@@ -1307,20 +1307,20 @@
if ($current->{'cmdname'} ne 'verb' or $current->{'type'} eq '') {
if (defined($closed_command)) {
$self->_command_error($current, $line_nr,
- $self->__("address@hidden %s seen before address@hidden closing
brace"),
+ __("address@hidden %s seen before address@hidden closing brace"),
$closed_command, $current->{'cmdname'});
} elsif (defined($interrupting_command)) {
$self->_command_error($current, $line_nr,
- $self->__("address@hidden seen before address@hidden closing brace"),
+ __("address@hidden seen before address@hidden closing brace"),
$interrupting_command, $current->{'cmdname'});
} else {
$self->_command_error($current, $line_nr,
- $self->__("%c%s missing closing brace"), ord('@'),
$current->{'cmdname'});
+ __("%c%s missing closing brace"), ord('@'), $current->{'cmdname'});
}
} else {
$self->_command_error($current, $line_nr,
- $self->__("address@hidden missing closing delimiter sequence: %s}"),
+ __("address@hidden missing closing delimiter sequence: %s}"),
$current->{'cmdname'}, $current->{'type'});
}
$current = $current->{'parent'};
@@ -1429,7 +1429,7 @@
if ($current->{'contents'}->[-1]->{'type'}
and $current->{'contents'}->[-1]->{'type'} eq 'before_item') {
if ($next_command and $next_command eq 'itemx') {
- $self->line_warn(sprintf($self->__("address@hidden should not begin
address@hidden"),
+ $self->line_warn(sprintf(__("address@hidden should not begin
address@hidden"),
$current->{'cmdname'}), $line_nr);
}
return;
@@ -1497,7 +1497,7 @@
} else {
my $after_paragraph = _check_no_text($table_gathered);
if ($after_paragraph) {
- $self->line_error($self->__("address@hidden must follow
address@hidden"), $line_nr);
+ $self->line_error(__("address@hidden must follow address@hidden"),
$line_nr);
}
if (scalar(@{$table_gathered->{'contents'}})) {
push @{$current->{'contents'}}, $table_gathered;
@@ -1664,7 +1664,7 @@
}
}
if ($empty_format) {
- $self->line_warn(sprintf($self->__("address@hidden has text but
no address@hidden"),
+ $self->line_warn(sprintf(__("address@hidden has text but no
address@hidden"),
$current->{'cmdname'}),
$current->{'line_nr'});
}
}
@@ -1692,14 +1692,14 @@
$closed_command, $interrupting_command);
} elsif (exists($block_commands{$current->{'cmdname'}})) {
if (defined($closed_command)) {
- $self->line_error(sprintf($self->__("address@hidden' expected `%s',
but saw `%s'"),
+ $self->line_error(sprintf(__("address@hidden' expected `%s', but saw
`%s'"),
$current->{'cmdname'}, $closed_command),
$line_nr);
} elsif ($interrupting_command) {
- $self->line_error(sprintf($self->__("address@hidden seen before
address@hidden %s"),
+ $self->line_error(sprintf(__("address@hidden seen before
address@hidden %s"),
$interrupting_command,
$current->{'cmdname'}),
$line_nr);
} else {
- $self->line_error(sprintf($self->__("no matching `%cend %s'"),
+ $self->line_error(sprintf(__("no matching `%cend %s'"),
ord('@'), $current->{'cmdname'}), $line_nr);
if ($block_commands{$current->{'cmdname'}} eq 'conditional') {
# in this case we are within an ignored conditional
@@ -1723,7 +1723,7 @@
print STDERR "CLOSING type $current->{'type'}\n" if ($self->{'DEBUG'});
if ($current->{'type'} eq 'bracketed') {
$self->_command_error($current, $line_nr,
- $self->__("misplaced %c"), ord('{'));
+ __("misplaced %c"), ord('{'));
if ($current->{'contents'}
and @{$current->{'contents'}}
and $current->{'contents'}->[0]->{'type'}
@@ -1826,7 +1826,7 @@
#$self->_close_command_cleanup($current);
$current = $current->{'parent'};
} elsif ($closed_command) {
- $self->line_error(sprintf($self->__("unmatched `%c%s'"),
+ $self->line_error(sprintf(__("unmatched `%c%s'"),
ord('@'), "end $closed_command"), $line_nr);
}
return ($closed_element, $current);
@@ -1982,7 +1982,7 @@
# Don't close STDIN
if ($previous_input->{'fh'} and $previous_input->{'name'} ne '-') {
if (!close($previous_input->{'fh'})) {
- $self->document_warn(sprintf($self->__("error on closing %s: %s"),
+ $self->document_warn(sprintf(__("error on closing %s: %s"),
$previous_input->{'name'}, $!));
}
@@ -2054,7 +2054,7 @@
} else {
# implicit quoting when there is one argument.
if ($args_total != 1) {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"macro `%s' called with too many args"),
$name), $line_nr);
}
@@ -2077,7 +2077,7 @@
($line, $line_nr) = _new_line($self, $line_nr, $macro);
if (!defined($line)) {
- $self->line_error(sprintf($self->__("address@hidden missing closing
brace"),
+ $self->line_error(sprintf(__("address@hidden missing closing brace"),
$name), $line_nr_orig);
return ($arguments, "\n", $line_nr);
}
@@ -2084,7 +2084,7 @@
}
}
if ($args_total == 0 and $arguments->[0] =~ /\S/) {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"macro `%s' declared without argument called with an
argument"),
$name), $line_nr);
}
@@ -2117,7 +2117,7 @@
if (defined($args_index->{$arg})) {
$result .= $args->[$args_index->{$arg}];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"\\ in address@hidden expansion followed `%s' instead of parameter
name or \\"),
$macro->{'element'}->{'args'}->[0]->{'text'}, $arg), $line_nr);
$result .= '\\' . $arg;
@@ -2523,7 +2523,7 @@
} elsif ($self->{'current_node'}) {
$index_entry->{'node'} = $self->{'current_node'};
} elsif (!$self->{'current_section'}) {
- $self->line_warn(sprintf($self->__("entry for index `%s' outside of any
node"),
+ $self->line_warn(sprintf(__("entry for index `%s' outside of any node"),
$index_name), $line_nr);
}
push @{$index->{'index_entries'}}, $index_entry;
@@ -2780,12 +2780,12 @@
$index_contents_normalized, $line_nr);
} else {
$self->_command_warn($current->{'parent'}, $line_nr,
- $self->__('missing name for @%s'),
+ __('missing name for @%s'),
$current->{'parent'}->{'extra'}->{'original_def_cmdname'});
}
} else {
$self->_command_warn($current->{'parent'}, $line_nr,
- $self->__('missing category for @%s'),
+ __('missing category for @%s'),
$current->{'parent'}->{'extra'}->{'original_def_cmdname'});
}
$current = $current->{'parent'}->{'parent'};
@@ -2820,7 +2820,7 @@
# FIXME could this happen? Should be a debug message?
if (!$content->{'cmdname'}) {
$self->_command_warn($current, $line_nr,
- $self->__("unexpected argument on address@hidden line: %s"),
+ __("unexpected argument on address@hidden line: %s"),
$current->{'cmdname'},
Texinfo::Convert::Texinfo::convert({ $content->{'contents'} }));
} elsif ($content->{'cmdname'} eq 'c'
@@ -2835,7 +2835,7 @@
$multitable->{'extra'}->{'max_columns'} = scalar(@prototype_row);
if (!scalar(@prototype_row)) {
$self->_command_warn($multitable, $line_nr,
- $self->__("empty multitable"));
+ __("empty multitable"));
}
$multitable->{'extra'}->{'prototypes'} = address@hidden;
@@ -2887,13 +2887,13 @@
and
defined($current->{'extra'}->{'block_command_line_contents'}->[0])) {
if
(scalar(@{$current->{'extra'}->{'block_command_line_contents'}->[0]}) > 1) {
$self->_command_error($current, $line_nr,
- $self->__("superfluous argument to address@hidden"),
+ __("superfluous argument to address@hidden"),
$current->{'cmdname'});
}
my $arg =
$current->{'extra'}->{'block_command_line_contents'}->[0]->[0];
if (!defined($arg->{'text'}) or $arg->{'text'} !~
/^(([[:digit:]]+)|([[:alpha:]]+))$/) {
$self->_command_error($current, $line_nr,
- $self->__("bad argument to address@hidden"),
+ __("bad argument to address@hidden"),
$current->{'cmdname'});
} else {
$spec = $arg->{'text'};
@@ -2904,12 +2904,12 @@
if (!$current->{'extra'}
or !$current->{'extra'}->{'command_as_argument'}) {
$self->_command_error($current, $line_nr,
- $self->__("%s requires an argument: the formatter for %citem"),
+ __("%s requires an argument: the formatter for %citem"),
$current->{'cmdname'}, ord('@'));
} elsif
(!$brace_commands{$current->{'extra'}->{'command_as_argument'}->{'cmdname'}}
and
!$self->{'definfoenclose'}->{$current->{'extra'}->{'command_as_argument'}->{'cmdname'}})
{
$self->_command_error($current, $line_nr,
- $self->__("command address@hidden not accepting argument in
brace should not be on address@hidden line"),
+ __("command address@hidden not accepting argument in brace
should not be on address@hidden line"),
$current->{'extra'}->{'command_as_argument'}->{'cmdname'},
$current->{'cmdname'});
delete $current->{'extra'}->{'command_as_argument'};
@@ -2944,7 +2944,7 @@
and ($current->{'cmdname'} eq 'itemize'
or $item_line_commands{$current->{'cmdname'}})) {
$self->_command_warn($current, $line_nr,
- $self->__("accent command address@hidden' not allowed as
address@hidden argument"),
+ __("accent command address@hidden' not allowed as address@hidden
argument"),
$current->{'extra'}->{'command_as_argument'}->{'cmdname'},
$current->{'cmdname'});
delete $current->{'extra'}->{'command_as_argument'};
@@ -3052,7 +3052,7 @@
if ($text eq '') {
if (not $superfluous_arg) {
$self->_command_warn($current, $line_nr,
- $self->__("address@hidden missing argument"),
$command);
+ __("address@hidden missing argument"),
$command);
}
# Otherwise an error message is issued below.
$current->{'extra'}->{'missing_argument'} = 1;
@@ -3066,7 +3066,7 @@
if (!exists $block_commands{$end_command}) {
$self->_command_warn($current, $line_nr,
- $self->__("unknown address@hidden %s"),
$end_command);
+ __("unknown address@hidden %s"), $end_command);
$end_command = undef;
} else {
print STDERR "END BLOCK $end_command\n" if ($self->{'DEBUG'});
@@ -3076,7 +3076,7 @@
pop @{$self->{'conditionals_stack'}};
} else {
$self->_command_error($current, $line_nr,
- $self->__("unmatched `%c%s'"), ord('@'), 'end');
+ __("unmatched `%c%s'"), ord('@'), 'end');
$end_command = undef;
}
}
@@ -3089,13 +3089,13 @@
= Texinfo::Convert::Texinfo::convert($current->{'args'}->[0]);
$texi_line =~ s/^\s*([[:alnum:]][[:alnum:]-]+)//;
$self->_command_error($current, $line_nr,
- $self->__("superfluous argument to address@hidden
%s: %s"),
+ __("superfluous argument to address@hidden %s:
%s"),
$command, $end_command, $texi_line);
$superfluous_arg = 0; # Don't issue another error message below.
}
} else {
$self->_command_error($current, $line_nr,
- $self->__("bad argument to address@hidden: %s"),
+ __("bad argument to address@hidden: %s"),
$command, $line);
}
} elsif ($superfluous_arg) {
@@ -3119,12 +3119,12 @@
'fh' => $filehandle };
} else {
$self->_command_error($current, $line_nr,
- $self->__("address@hidden: could not open %s:
%s"),
+ __("address@hidden: could not open %s: %s"),
$command, $text, $!);
}
} else {
$self->_command_error($current, $line_nr,
- $self->__("address@hidden: could not find %s"),
+ __("address@hidden: could not find %s"),
$command, $text);
}
} elsif ($command eq 'verbatiminclude') {
@@ -3135,7 +3135,7 @@
my ($texinfo_encoding, $perl_encoding, $input_encoding)
= Texinfo::Encoding::encoding_alias($text);
$self->_command_warn($current, $line_nr,
- $self->__("encoding `%s' is not a canonical texinfo
encoding"),
+ __("encoding `%s' is not a canonical texinfo encoding"),
$text)
if (!$texinfo_encoding or $texinfo_encoding ne lc($text));
if ($input_encoding) {
@@ -3143,7 +3143,7 @@
}
if (!$perl_encoding) {
$self->_command_warn($current, $line_nr,
- $self->__("unrecognized encoding name `%s'"), $text);
+ __("unrecognized encoding name `%s'"), $text);
} else {
$current->{'extra'}->{'input_perl_encoding'} = $perl_encoding;
@@ -3180,7 +3180,7 @@
$texi_line =~ s/\s*$//;
$self->_command_error($current, $line_nr,
- $self->__("bad argument to address@hidden: %s"),
+ __("bad argument to address@hidden: %s"),
$command, $texi_line);
}
@@ -3205,7 +3205,7 @@
# empty @top is allowed
if (!scalar(@contents) and $command ne 'top') {
$self->_command_warn($current, $line_nr,
- $self->__("address@hidden missing argument"), $command);
+ __("address@hidden missing argument"), $command);
$current->{'extra'}->{'missing_argument'} = 1;
} else {
$current->{'extra'}->{'misc_content'} = address@hidden;
@@ -3271,7 +3271,7 @@
} elsif ($command eq 'setfilename'
and ($self->{'current_node'} or $self->{'current_section'})) {
$self->_command_warn($misc_cmd, $line_nr,
- $self->__("address@hidden after the first element"), $command);
+ __("address@hidden after the first element"), $command);
# columnfractions
} elsif ($command eq 'columnfractions') {
# in a multitable, we are in a block_line_arg
@@ -3278,7 +3278,7 @@
if (!$current->{'parent'} or !$current->{'parent'}->{'cmdname'}
or $current->{'parent'}->{'cmdname'} ne 'multitable') {
$self->_command_error($current, $line_nr,
- $self->__("address@hidden only meaningful on a address@hidden
line"),
+ __("address@hidden only meaningful on a address@hidden line"),
$command);
} else {
# This is the multitable block_line_arg line context
@@ -3324,7 +3324,7 @@
$self->{'current_part'} = $current;
if ($self->{'current_node'}
and !$self->{'current_node'}->{'extra'}->{'associated_section'}) {
- $self->line_warn (sprintf($self->__(
+ $self->line_warn (sprintf(__(
"address@hidden precedes address@hidden, but parts may not be
associated with nodes"),
$command), $line_nr);
}
@@ -3424,7 +3424,7 @@
my ($self, $parsed_node, $command, $line_nr) = @_;
if (!defined($parsed_node) or !$parsed_node->{'node_content'}) {
- $self->line_error (sprintf($self->__("empty argument in address@hidden"),
+ $self->line_error (sprintf(__("empty argument in address@hidden"),
$command), $line_nr);
return 0;
} else {
@@ -3437,7 +3437,7 @@
my ($self, $parsed_node, $line_nr) = @_;
if ($parsed_node and $parsed_node->{'manual_content'}) {
- $self->line_error (sprintf($self->__("syntax for an external node used for
`%s'"),
+ $self->line_error (sprintf(__("syntax for an external node used for `%s'"),
Texinfo::Structuring::node_extra_to_texi($parsed_node)), $line_nr)
}
}
@@ -3460,7 +3460,7 @@
my $normalized_menu_entry_name =
Texinfo::Convert::NodeNameNormalization::normalize_node($arg);
if ($normalized_menu_entry_name !~ /[^-]/) {
- $self->line_warn(sprintf($self->__("empty menu entry name in `%s'"),
+ $self->line_warn(sprintf(__("empty menu entry name in `%s'"),
Texinfo::Convert::Texinfo::convert($current)), $line_nr);
}
} elsif ($arg->{'type'} eq 'menu_entry_node') {
@@ -3468,7 +3468,7 @@
my $parsed_entry_node = _parse_node_manual($arg);
if (! defined($parsed_entry_node)) {
if ($self->{'SHOW_MENU'}) {
- $self->line_error ($self->__("empty node name in menu entry"),
$line_nr);
+ $self->line_error (__("empty node name in menu entry"), $line_nr);
}
} else {
delete $parsed_entry_node->{'normalized'};
@@ -3539,7 +3539,7 @@
$marked_as_invalid_command) = @_;
if (defined($invalid_parent)) {
- $self->line_warn(sprintf($self->__("address@hidden should not appear in
address@hidden"),
+ $self->line_warn(sprintf(__("address@hidden should not appear in
address@hidden"),
$command, $invalid_parent), $line_nr);
$marked_as_invalid_command->{'extra'}->{'invalid_nesting'} = 1
if (defined($marked_as_invalid_command));
@@ -3699,12 +3699,12 @@
} else {
push @{$current->{'contents'}},
{ 'text' => $1, 'type' => 'raw', 'parent' => $current };
- $self->line_warn(sprintf($self->__("address@hidden %s should only
appear at the beginning of a line"),
+ $self->line_warn(sprintf(__("address@hidden %s should only appear
at the beginning of a line"),
$end_command), $line_nr);
}
# if there is a user defined macro that expandes to spaces, there
# will be a spurious warning.
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("superfluous argument to address@hidden %s: %s"), 'end',
$end_command,
$line), $line_nr)
if ($line =~ /\S/ and $line !~ /address@hidden(omment)?\b/);
@@ -3720,14 +3720,14 @@
if ($current->{'args'} and $current->{'args'}->[0]) {
my $name = $current->{'args'}->[0]->{'text'};
if (exists($self->{'macros'}->{$name})) {
- $self->line_warn(sprintf($self->__("macro `%s' previously
defined"),
+ $self->line_warn(sprintf(__("macro `%s' previously defined"),
$name), $current->{'line_nr'});
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"here is the previous definition of `%s'"),
$name), $self->{'macros'}->{$name}->{'element'}->{'line_nr'});
}
if ($all_commands{$name}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"redefining Texinfo language command:
address@hidden"),
$name), $current->{'line_nr'});
}
@@ -3794,7 +3794,7 @@
if (!defined($current->{'parent'}->{'type'})) {
if ($line =~ /^$/) {
$current->{'parent'}->{'type'} = '';
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("address@hidden without associated character"), 'verb'),
$line_nr);
} else {
$line =~ s/^(.)//;
@@ -3864,7 +3864,7 @@
} elsif (($args_number >= 2) or ($args_number <1)) {
# as agreed on the bug-texinfo mailing list, no warn when zero
# arg and not called with {}.
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden defined with zero or more than one argument should be
invoked with {}"),
$command), $line_nr)
if ($args_number >= 2);
@@ -3889,7 +3889,7 @@
}
if ($self->{'MAX_MACRO_CALL_NESTING'}
and scalar(@{$self->{'macro_stack'}}) >
$self->{'MAX_MACRO_CALL_NESTING'}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"macro call nested too deeply (set MAX_NESTED_MACROS to override; current
value %d)"),
$self->{'MAX_MACRO_CALL_NESTING'}), $line_nr);
next;
@@ -3898,7 +3898,7 @@
my $found = 0;
foreach my $macro (@{$self->{'macro_stack'}}) {
if ($macro->{'args'}->[0]->{'text'} eq $command) {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"recursive call of macro %s is not allowed; use address@hidden if
needed"),
$command), $line_nr);
$found = 1;
@@ -3954,13 +3954,13 @@
if (!defined($current->{'extra'}->{'spaces'}));
$current->{'extra'}->{'spaces'} .= $1;
} else {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("accent command address@hidden' must not be followed by
whitespace"),
$current->{'cmdname'}), $line_nr);
$current = $current->{'parent'};
}
} elsif ($line =~ /^\@/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("use braces to give a command as an argument to
address@hidden"),
$current->{'cmdname'}), $line_nr);
$current = $current->{'parent'};
@@ -3973,7 +3973,7 @@
'parent' => $following_arg } ];
$current->{'args'} = [ $following_arg ];
if ($current->{'cmdname'} eq 'dotless' and $1 ne 'i' and $1 ne
'j') {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s expects `i' or `j' as argument, not `%s'"),
ord('@'), $current->{'cmdname'}, $1), $line_nr);
}
@@ -3984,7 +3984,7 @@
} else { # The accent is at end of line
# whitespace for commands with letter.
print STDERR "STRANGE ACC address@hidden>{'cmdname'}\n" if
($self->{'DEBUG'});
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("accent command address@hidden' must not be followed by new
line"),
$current->{'cmdname'}), $line_nr);
$current = $current->{'parent'};
@@ -3996,7 +3996,7 @@
and $line =~ s/^\s+//) {
next;
}
- $self->line_error(sprintf($self->__("address@hidden expected
braces"),
+ $self->line_error(sprintf(__("address@hidden expected braces"),
$current->{'cmdname'}), $line_nr);
$current = $current->{'parent'};
}
@@ -4154,11 +4154,11 @@
'parent' => $current };
if (!$self->{'in_gdt'}) {
$self->line_warn(
- sprintf($self->__("undefined flag: %s"), $value), $line_nr);
+ sprintf(__("undefined flag: %s"), $value), $line_nr);
}
}
} else {
- $self->line_error($self->__("bad syntax for address@hidden"),
$line_nr);
+ $self->line_error(__("bad syntax for address@hidden"), $line_nr);
}
next;
}
@@ -4165,12 +4165,12 @@
if (defined($deprecated_commands{$command})) {
if ($deprecated_commands{$command} eq '') {
- $self->line_warn(sprintf($self->__("%c%s is obsolete."),
+ $self->line_warn(sprintf(__("%c%s is obsolete."),
ord('@'), $command), $line_nr);
} else {
- $self->line_warn(sprintf($self->__("%c%s is obsolete; %s"),
+ $self->line_warn(sprintf(__("%c%s is obsolete; %s"),
ord('@'), $command,
- $self->__($deprecated_commands{$command})), $line_nr);
+ __($deprecated_commands{$command})), $line_nr);
}
}
@@ -4183,7 +4183,7 @@
and not _abort_empty_line($self, $current)
and $begin_line_commands{$command}) {
$self->line_warn(
- sprintf($self->__("address@hidden should only appear at the
beginning of a line"),
+ sprintf(__("address@hidden should only appear at the beginning
of a line"),
$command), $line_nr);
}
@@ -4272,7 +4272,7 @@
while ($parent) {
if ($parent->{'cmdname'} and $parent->{'cmdname'} eq
'copying') {
$self->line_error(
- sprintf($self->__("address@hidden not allowed inside
address@hidden' block"),
+ sprintf(__("address@hidden not allowed inside
address@hidden' block"),
$command, $parent->{'cmdname'}), $line_nr);
$ignored = 1;
last;
@@ -4281,7 +4281,7 @@
}
} elsif ($in_heading_commands{$command}) {
$self->line_error(
- sprintf($self->__("address@hidden should only appear in
heading or footing"),
+ sprintf(__("address@hidden should only appear in heading or
footing"),
$command), $line_nr);
$only_in_headings = 1;
}
@@ -4404,7 +4404,7 @@
push @{$parent->{'contents'}}, $misc;
$current = $parent->{'contents'}->[-1];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden not meaningful inside
address@hidden' block"),
$command, $parent->{'cmdname'}), $line_nr);
}
@@ -4421,7 +4421,7 @@
# commands is 'skipspace' we set $line_arg here.
$line_arg = 1;
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden not meaningful inside
address@hidden' block"),
$command, $parent->{'cmdname'}), $line_nr);
$current = _begin_preformatted($self, $current);
@@ -4432,15 +4432,15 @@
or $command eq 'tab') {
if (!$parent->{'extra'}->{'max_columns'}) {
$self->line_warn(
- sprintf($self->__("address@hidden in empty
multitable"),
+ sprintf(__("address@hidden in empty multitable"),
$command), $line_nr);
} elsif ($command eq 'tab') {
my $row = $parent->{'contents'}->[-1];
die if (!$row->{'type'});
if ($row->{'type'} eq 'before_item') {
- $self->line_error($self->__("address@hidden before
address@hidden"), $line_nr);
+ $self->line_error(__("address@hidden before
address@hidden"), $line_nr);
} elsif ($row->{'cells_count'} >=
$parent->{'extra'}->{'max_columns'}) {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"too many columns in multitable item (max %d)"),
$parent->{'extra'}->{'max_columns'}), $line_nr);
} else {
@@ -4471,17 +4471,17 @@
$current = $row->{'contents'}->[-1];
}
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden not meaningful inside
address@hidden' block"),
$command, $parent->{'cmdname'}), $line_nr);
}
$current = _begin_preformatted($self, $current);
} elsif ($command eq 'tab') {
- $self->line_error($self->__(
+ $self->line_error(__(
"ignoring address@hidden outside of multitable"),
$line_nr);
$current = _begin_preformatted($self, $current);
} else {
- $self->line_error (sprintf($self->__(
+ $self->line_error (sprintf(__(
"address@hidden outside of table or list"), $command),
$line_nr);
$current = _begin_preformatted($self, $current);
}
@@ -4520,7 +4520,7 @@
if (!$current->{'cmdname'}
or $current->{'cmdname'} ne $base_command
or $after_paragraph) {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"must be after address@hidden' to use
address@hidden'"),
$base_command, $command), $line_nr);
$current->{'contents'}->[-1]->{'extra'}->{'not_after_command'} = 1;
@@ -4562,12 +4562,12 @@
}
}
if (!$found) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden not meaningful outside address@hidden' and
address@hidden' environments"),
$command), $current->{'line_nr'});
}
} elsif ($command eq 'dircategory' and $self->{'current_node'}) {
- $self->line_warn($self->__("address@hidden after first
node"),
+ $self->line_warn(__("address@hidden after first node"),
$line_nr);
}
@@ -4631,10 +4631,10 @@
}
print STDERR "CONDITIONAL address@hidden $name:
$ifvalue_true\n" if ($self->{'DEBUG'});
} elsif ($line !~ /\S/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'ifcommanddefined'
@@ -4657,10 +4657,10 @@
}
print STDERR "CONDITIONAL address@hidden $name:
$ifvalue_true\n" if ($self->{'DEBUG'});
} elsif ($line !~ /\S/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command =~ /^ifnot(.*)/) {
@@ -4772,7 +4772,7 @@
if ($region_commands{$command}) {
if (@{$self->{'regions_stack'}}) {
$self->line_error(
- sprintf($self->__("region %s inside region %s is not allowed"),
+ sprintf(__("region %s inside region %s is not allowed"),
$command, $self->{'regions_stack'}->[-1]->{'cmdname'}),
$line_nr);
}
@@ -4789,7 +4789,7 @@
if ($self->{'current_node'}) {
if ($command eq 'direntry') {
if ($self->{'SHOW_MENU'}) {
- $self->line_warn($self->__("address@hidden after first
node"),
+ $self->line_warn(__("address@hidden after first node"),
$line_nr);
}
} elsif ($command eq 'menu') {
@@ -4797,15 +4797,15 @@
or $root_commands{$current->{'parent'}->{'cmdname'}}) {
push @{$self->{'current_node'}->{'menus'}}, $current;
} else {
- $self->line_warn($self->__("address@hidden in invalid
context"),
+ $self->line_warn(__("address@hidden in invalid
context"),
$line_nr);
}
}
} elsif ($command ne 'direntry') {
if ($self->{'SHOW_MENU'}) {
- $self->line_error(sprintf($self->__("address@hidden seen
before first address@hidden"),
+ $self->line_error(sprintf(__("address@hidden seen before
first address@hidden"),
$command), $line_nr);
- $self->line_error($self->__(
+ $self->line_error(__(
"perhaps your address@hidden node should be wrapped in address@hidden
rather than address@hidden"),
$line_nr);
}
@@ -4866,7 +4866,7 @@
{ 'cmdname' => $command, 'parent' => $current };
# FIXME generalize?
if ($command eq '\\' and $self->{'context_stack'}->[-1] ne 'math') {
- $self->line_warn(sprintf($self->__("address@hidden should only
appear in math context"),
+ $self->line_warn(sprintf(__("address@hidden should only appear in
math context"),
$command), $line_nr);
}
if ($command eq "\n") {
@@ -4874,7 +4874,7 @@
last;
}
} else {
- $self->line_error(sprintf($self->__("unknown command `%s'"),
+ $self->line_error(sprintf(__("unknown command `%s'"),
$command), $line_nr);
}
} elsif ($separator_match) {
@@ -4884,7 +4884,7 @@
if ($separator eq '@') {
# this may happen with a @ at the very end of a file, therefore
# not followed by anything.
- $self->line_error($self->__("unexpected \@"), $line_nr);
+ $self->line_error(__("unexpected \@"), $line_nr);
} elsif ($separator eq '{') {
_abort_empty_line($self, $current);
if ($current->{'cmdname'}
@@ -4911,12 +4911,12 @@
$float = $float->{'parent'};
}
if (!($float->{'cmdname'} and $float->{'cmdname'} eq
'float')) {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden is not meaningful outside
address@hidden' environment"),
$command), $line_nr);
$float = undef;
} else {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden should be right below
address@hidden'"),
$command), $line_nr);
}
@@ -4925,7 +4925,7 @@
}
if ($float) {
if ($float->{'extra'}->{$command}) {
- $self->line_warn(sprintf($self->__("ignoring multiple
address@hidden"),
+ $self->line_warn(sprintf(__("ignoring multiple
address@hidden"),
$command), $line_nr);
} else {
$current->{'parent'}->{'extra'}->{'float'} = $float;
@@ -4999,7 +4999,7 @@
$current = $current->{'contents'}->[-1];
print STDERR "BRACKETED in math\n" if ($self->{'DEBUG'});
} else {
- $self->line_error(sprintf($self->__("misplaced %c"),
+ $self->line_error(sprintf(__("misplaced %c"),
ord('{')), $line_nr);
}
@@ -5041,7 +5041,7 @@
if (defined($brace_commands{$closed_command})
and $brace_commands{$closed_command} == 0
and @{$current->{'contents'}}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"command address@hidden does not accept
arguments"),
$closed_command), $line_nr);
}
@@ -5071,7 +5071,7 @@
or ($closed_command ne 'inforef'
and !defined($args[0]) and !defined($args[3])
and !defined($args[4]))) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"command address@hidden missing a node or external manual
argument"),
$closed_command), $line_nr);
} else {
@@ -5090,7 +5090,7 @@
Texinfo::Convert::NodeNameNormalization::normalize_node(
{'contents' =>
$args[1]});
if ($normalized_cross_ref_name !~ /[^-]/) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"in address@hidden empty cross reference name after
expansion `%s'"),
$closed_command,
Texinfo::Convert::Texinfo::convert({'contents' =>
$args[1]})),
@@ -5101,7 +5101,7 @@
my $normalized_cross_ref_title =
Texinfo::Convert::NodeNameNormalization::normalize_node({'contents' =>
$args[2]});
if ($normalized_cross_ref_title !~ /[^-]/) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"in address@hidden empty cross reference title after
expansion `%s'"),
$closed_command,
Texinfo::Convert::Texinfo::convert({'contents' =>
$args[2]})),
@@ -5115,7 +5115,7 @@
or !defined($image->{'args'}->[0])
or scalar(@{$image->{'args'}->[0]->{'contents'}}) == 0) {
$self->line_error(
- $self->__("address@hidden missing filename argument"),
$line_nr);
+ __("address@hidden missing filename argument"), $line_nr);
}
$image->{'extra'}->{'input_perl_encoding'}
= $self->{'INPUT_PERL_ENCODING'}
@@ -5126,7 +5126,7 @@
my $text = $current->{'contents'}->[0]->{'text'};
if (!defined ($text)
or ($text ne 'i' and $text ne 'j')) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s expects `i' or `j' as argument, not `%s'"),
ord('@'), $dotless->{'cmdname'},
Texinfo::Convert::Texinfo::convert($current)), $line_nr);
@@ -5149,7 +5149,7 @@
or !defined($current_command->{'args'}->[0])
or scalar(@{$current_command->{'args'}->[0]->{'contents'}})
== 0) {
$self->line_warn(
- sprintf($self->__("address@hidden missing first argument"),
+ sprintf(__("address@hidden missing first argument"),
$current_command->{'cmdname'}), $line_nr);
}
} elsif ($current->{'parent'}->{'cmdname'} eq 'errormsg') {
@@ -5163,17 +5163,17 @@
_trim_spaces_comment_from_content (address@hidden);
my $arg = $contents[0]->{'text'};
if (!defined($arg) || !$arg) {
- $self->line_warn($self->__("no argument specified for
address@hidden"),
+ $self->line_warn(__("no argument specified for
address@hidden"),
$line_nr);
} elsif ($arg !~ /^[0-9A-Fa-f]+$/) {
$self->line_error(
- sprintf($self->__("non-hex digits in argument for address@hidden:
%s"), $arg),
+ sprintf(__("non-hex digits in argument for address@hidden: %s"),
$arg),
$line_nr);
} elsif (length ($arg) < 4) {
# Perl doesn't mind, but too much trouble to do in TeX.
- $self->line_warn(sprintf($self->__("fewer than four hex digits
in argument for address@hidden: %s"), $arg),
+ $self->line_warn(sprintf(__("fewer than four hex digits in
argument for address@hidden: %s"), $arg),
$line_nr);
} else {
@@ -5190,7 +5190,7 @@
# ok, value can be given to hex(), so try it.
if ($@ or hex($arg) > 0x10FFFF) {
$self->line_error(
- sprintf($self->__("argument for address@hidden exceeds Unicode maximum
0x10FFFF: %s"),
+ sprintf(__("argument for address@hidden exceeds Unicode maximum 0x10FFFF:
%s"),
$arg),
$line_nr);
}
@@ -5256,7 +5256,7 @@
if ($close_preformatted_commands{$closed_command});
}
} else {
- $self->line_error(sprintf($self->__("misplaced %c"),
+ $self->line_error(sprintf(__("misplaced %c"),
ord('}')), $line_nr);
}
} elsif ($separator eq ','
@@ -5395,7 +5395,7 @@
and $current->{'type'} eq 'misc_line_arg'
and $current->{'parent'}->{'cmdname'}
and $current->{'parent'}->{'cmdname'} eq 'node') {
- $self->line_warn($self->__("superfluous arguments for node"),
$line_nr);
+ $self->line_warn(__("superfluous arguments for node"), $line_nr);
# end of menu node (. must be followed by a space to stop the node).
} elsif (($separator =~ /[,\t.]/ and $current->{'type'}
and $current->{'type'} eq 'menu_entry_node')
@@ -5446,7 +5446,7 @@
}
while (@{$self->{'conditionals_stack'}}) {
my $end_conditional = pop @{$self->{'conditionals_stack'}};
- $self->line_error(sprintf($self->__("expected address@hidden %s"),
$end_conditional),
+ $self->line_error(sprintf(__("expected address@hidden %s"),
$end_conditional),
$line_nr);
}
$current = _close_commands($self, $current, $line_nr);
@@ -5490,10 +5490,10 @@
$args = [$name, $arg];
$self->{'values'}->{$name} = $arg;
} elsif ($line !~ /\S/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'clear') {
@@ -5503,10 +5503,10 @@
delete $self->{'values'}->{$1};
$has_comment = 1 if (defined($3));
} elsif ($line !~ /\S/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'unmacro') {
@@ -5517,10 +5517,10 @@
$has_comment = 1 if (defined($3));
print STDERR "UNMACRO $1\n" if ($self->{'DEBUG'});
} elsif ($line !~ /\S/) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'clickstyle') {
@@ -5532,7 +5532,7 @@
$remaining =~
s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
$has_comment = 1 if (defined($4));
} else {
- $self->line_error (sprintf($self->__(
+ $self->line_error (sprintf(__(
"address@hidden should only accept an address@hidden as
argument, not `%s'"),
$command, $line), $line_nr);
}
@@ -5542,7 +5542,7 @@
if (defined($remaining)) {
chomp($remaining);
if ($remaining ne '') {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"remaining argument on address@hidden line: %s"),
$command, $remaining), $line_nr);
}
@@ -5590,7 +5590,7 @@
if (! @contents) {
$self->_command_error($line_command, $line_nr,
- $self->__("address@hidden missing argument"), $command);
+ __("address@hidden missing argument"), $command);
$line_command->{'extra'}->{'missing_argument'} = 1;
return undef;
}
@@ -5597,7 +5597,7 @@
if (@contents > 1
or (!defined($contents[0]->{'text'}))) {
- $self->line_error (sprintf($self->__("superfluous argument to
address@hidden"),
+ $self->line_error (sprintf(__("superfluous argument to address@hidden"),
$command), $line_nr);
}
return undef if (!defined($contents[0]->{'text'}));
@@ -5612,12 +5612,12 @@
$args = [$1, $3];
$self->{'aliases'}->{$new_command} = $existing_command;
if (exists($block_commands{$existing_command})) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("environment command %s as argument to
address@hidden"),
$existing_command, $command), $line_nr);
}
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad argument to address@hidden"), $command),
$line_nr);
}
@@ -5632,13 +5632,13 @@
# command and a user command defined with @definfoenclose.
# %keep_line_nr_brace_commands is one example of this.
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad argument to address@hidden"), $command),
$line_nr);
}
} elsif ($command eq 'columnfractions') {
my @possible_fractions = split (/\s+/, $line);
if (address@hidden) {
- $self->line_error (sprintf($self->__("empty address@hidden"), $command),
+ $self->line_error (sprintf(__("empty address@hidden"), $command),
$line_nr);
} else {
foreach my $fraction (@possible_fractions) {
@@ -5645,7 +5645,7 @@
if ($fraction =~ /^(\d*\.\d+)|(\d+)\.?$/) {
push @$args, $fraction;
} else {
- $self->line_error (sprintf($self->
+ $self->line_error (sprintf(
__("column fraction not a number: %s"),
$fraction), $line_nr);
}
@@ -5655,7 +5655,7 @@
if ($line =~ /^([0-9]+)$/) {
$args = [$1];
} else {
- $self->line_error(sprintf($self->__("address@hidden arg must be numeric,
not `%s'"),
+ $self->line_error(sprintf(__("address@hidden arg must be numeric, not
`%s'"),
$line), $line_nr);
}
} elsif ($command eq 'defindex' || $command eq 'defcodeindex') {
@@ -5663,7 +5663,7 @@
if ($line =~ /^([[:alnum:]][[:alnum:]\-]*)$/) {
my $name = $1;
if ($forbidden_index_name{$name}) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("reserved index name %s"),$name), $line_nr);
} else {
my $in_code = 0;
@@ -5682,7 +5682,7 @@
$self->{'command_index'}->{$name.'index'} = $name;
}
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad argument to address@hidden: %s"), $command, $line),
$line_nr);
}
} elsif ($command eq 'synindex' || $command eq 'syncodeindex') {
@@ -5690,10 +5690,10 @@
if ($line =~
/^([[:alnum:]][[:alnum:]\-]*)\s+([[:alnum:]][[:alnum:]\-]*)$/) {
my $index_from = $1;
my $index_to = $2;
- $self->line_error(sprintf($self->__("unknown source index in
address@hidden: %s"),
+ $self->line_error(sprintf(__("unknown source index in address@hidden:
%s"),
$command, $index_from), $line_nr)
unless $self->{'index_names'}->{$index_from};
- $self->line_error(sprintf($self->__("unknown destination index in
address@hidden: %s"),
+ $self->line_error(sprintf(__("unknown destination index in
address@hidden: %s"),
$command, $index_to), $line_nr)
unless $self->{'index_names'}->{$index_to};
if ($self->{'index_names'}->{$index_from}
@@ -5722,13 +5722,13 @@
$index_to_info->{'contained_indices'}->{$index_from} = 1;
$args = [$index_from, $index_to];
} else {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"address@hidden leads to a merging of %s in itself,
ignoring"),
$command, $index_from), $line_nr);
}
}
} else {
- $self->line_error(sprintf($self->__("bad argument to address@hidden:
%s"),
+ $self->line_error(sprintf(__("bad argument to address@hidden: %s"),
$command, $line), $line_nr);
}
} elsif ($command eq 'printindex') {
@@ -5736,12 +5736,12 @@
if ($line =~ /^([[:alnum:]][[:alnum:]\-]*)$/) {
my $name = $1;
if (!exists($self->{'index_names'}->{$name})) {
- $self->line_error(sprintf($self->__("unknown index `%s' in
address@hidden"),
+ $self->line_error(sprintf(__("unknown index `%s' in address@hidden"),
$name), $line_nr);
} else {
if ($self->{'merged_indices'}->{$name}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"printing an index `%s' merged in another one, `%s'"),
$name, $self->{'merged_indices'}->{$name}),
$line_nr);
@@ -5749,7 +5749,7 @@
if (!defined($self->{'current_node'})
and !defined($self->{'current_section'})
and !scalar(@{$self->{'regions_stack'}})) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"printindex before document beginning: address@hidden
%s"),
$name), $line_nr);
}
@@ -5756,7 +5756,7 @@
$args = [$name];
}
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("bad argument to address@hidden: %s"), $command, $line),
$line_nr);
}
} elsif (grep {$_ eq $command} ('everyheadingmarks', 'everyfootingmarks',
@@ -5765,7 +5765,7 @@
if ($line eq 'top' or $line eq 'bottom') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `top' or `bottom', not
`%s'"),
$command, $line), $line_nr);
}
@@ -5773,7 +5773,7 @@
if ($line eq '10' or $line eq '11') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"Only address@hidden 10 or 11 is supported, not `%s'"),
$command, $line), $line_nr);
}
@@ -5781,7 +5781,7 @@
if ($line eq 'separate' or $line eq 'end') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `separate' or `end',
not `%s'"),
$command, $line), $line_nr);
}
@@ -5789,7 +5789,7 @@
if ($line eq 'on' or $line eq 'off' or $line eq 'odd') {
$args = [$1];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `on', `off' or `odd',
not `%s'"),
$command, $line), $line_nr);
}
@@ -5798,7 +5798,7 @@
($line =~ /^(\.[0-9]+)$/)) {
$args = [$1];
} else {
- $self->line_error(sprintf($self->__("bad argument to address@hidden:
%s"),
+ $self->line_error(sprintf(__("bad argument to address@hidden: %s"),
$command, $line), $line_nr);
}
} elsif ($command eq 'paragraphindent') {
@@ -5807,12 +5807,12 @@
if ($value =~ /^([0-9]+)$/ or $value eq 'none' or $value eq 'asis') {
$args = [$1];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be numeric/`none'/`asis', not `%s'"),
$value), $line_nr);
}
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be numeric/`none'/`asis', not `%s'"),
$line), $line_nr);
}
@@ -5820,7 +5820,7 @@
if ($line eq 'none' or $line eq 'insert') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `none' or `insert', not `%s'"),
$line), $line_nr);
}
@@ -5830,7 +5830,7 @@
} elsif ($line =~ /^(asis)$/) {
$args = [$1];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be numeric/`asis', not `%s'"),
$line), $line_nr);
}
@@ -5843,7 +5843,7 @@
if ($line eq 'on' or $line eq 'off') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__("expected address@hidden on or off,
not `%s'"),
+ $self->line_error(sprintf(__("expected address@hidden on or off, not
`%s'"),
$command, $line), $line_nr);
}
} elsif ($command eq 'kbdinputstyle') {
@@ -5851,7 +5851,7 @@
$self->{'kbdinputstyle'} = $line;
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `code'/`example'/`distinct', not `%s'"),
$line), $line_nr);
}
@@ -5859,7 +5859,7 @@
if ($line eq 'true' or $line eq 'false') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `true' or `false', not `%s'"),
$line), $line_nr);
}
@@ -5867,7 +5867,7 @@
if ($line eq 'after' or $line eq 'before' or $line eq 'none') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__(
+ $self->line_error(sprintf(__(
"address@hidden arg must be `after'/`before'/`none', not `%s'"),
$line), $line_nr);
}
@@ -5876,7 +5876,7 @@
or $line eq 'double' or $line eq 'singleafter' or $line eq
'doubleafter') {
$args = [$line];
} else {
- $self->line_error(sprintf($self->__("bad argument to address@hidden:
%s"),
+ $self->line_error(sprintf(__("bad argument to address@hidden: %s"),
$command, $line), $line_nr);
}
}
Modified: trunk/tp/Texinfo/Report.pm
===================================================================
--- trunk/tp/Texinfo/Report.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Report.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -58,18 +58,6 @@
return ($self->{'errors_warnings'}, $self->{'error_nrs'});
}
-sub __($$)
-{
- my $self = shift;
- return &{$self->{'gettext'}}(@_);
-}
-
-sub __p($$$)
-{
- my $self = shift;
- return &{$self->{'pgettext'}}(@_);
-}
-
sub new($)
{
my $self = shift;
@@ -96,11 +84,11 @@
if ($self->get_conf('TEST'));
my $warn_line;
if ($line_number->{'macro'} ne '') {
- $warn_line = sprintf($self->__p("Texinfo source file warning",
+ $warn_line = sprintf(__p("Texinfo source file warning",
"%s:%d: warning: %s (possibly involving
address@hidden)\n"),
$file, $line_number->{'line_nr'}, $text, $line_number->{'macro'});
} else {
- $warn_line = sprintf($self->__p("Texinfo source file warning",
+ $warn_line = sprintf(__p("Texinfo source file warning",
"%s:%d: warning: %s\n"),
$file, $line_number->{'line_nr'}, $text);
}
@@ -144,10 +132,10 @@
my $warn_line;
if (defined($self->get_conf('PROGRAM')) and $self->get_conf('PROGRAM') ne
'') {
- $warn_line = sprintf($self->__p("whole document warning", "%s: warning:
%s\n"),
+ $warn_line = sprintf(__p("whole document warning", "%s: warning: %s\n"),
$self->get_conf('PROGRAM'), $text);
} else {
- $warn_line = sprintf($self->__p("whole document warning", "warning:
%s\n"),
+ $warn_line = sprintf(__p("whole document warning", "warning: %s\n"),
$text);
}
push @{$self->{'errors_warnings'}},
@@ -182,12 +170,12 @@
my $warn_line;
if (!defined($file)) {
- $warn_line = sprintf($self->__p("file warning", "warning: %s\n"), $text);
+ $warn_line = sprintf(__p("file warning", "warning: %s\n"), $text);
} elsif (!defined($line_nr)) {
- $warn_line = sprintf($self->__p("file warning", "%s: warning: %s\n"),
+ $warn_line = sprintf(__p("file warning", "%s: warning: %s\n"),
$file, $text);
} else {
- $warn_line = sprintf($self->__p("file warning", "%s:%d: warning: %s\n"),
+ $warn_line = sprintf(__p("file warning", "%s:%d: warning: %s\n"),
$file, $line_nr, $text);
}
#print STDERR "REPORT FILE_LINE_WARN $self $self->{'errors_warnings'}\n";
@@ -227,10 +215,22 @@
# gettext.
Locale::Messages->select_package ('gettext_pp');
-# FIXME make those configurable? Set them with call to new?
my $strings_textdomain = 'texinfo_document';
my $messages_textdomain = 'texinfo';
+sub __($) {
+ my $msgid = shift;
+ return Locale::Messages::dgettext($messages_textdomain, $msgid);
+}
+
+sub __p($$) {
+ my $context = shift;
+ my $msgid = shift;
+ return Locale::Messages::dpgettext($messages_textdomain, $context, $msgid);
+}
+
+
+
# libintl converts between encodings but doesn't decode them into the
# perl internal format. This is only called if the encoding is a proper
# perl encoding.
Modified: trunk/tp/Texinfo/Structuring.pm
===================================================================
--- trunk/tp/Texinfo/Structuring.pm 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/Texinfo/Structuring.pm 2018-08-12 19:01:17 UTC (rev 8045)
@@ -29,6 +29,8 @@
use strict;
+use Texinfo::Common;
+
# for debugging. Also for index entries sorting.
use Texinfo::Convert::Text;
# for error messages
@@ -177,7 +179,7 @@
# new command is below
if ($previous_section->{'level'} < $level) {
if ($level - $previous_section->{'level'} > 1) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("raising the section level of address@hidden which is too
low"),
$content->{'cmdname'}), $content->{'line_nr'});
$content->{'level'} = $previous_section->{'level'} + 1;
@@ -209,12 +211,12 @@
if ($content->{'cmdname'} eq 'part') {
$new_upper_part_element = 1;
if ($level < $up->{'level'}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"no chapter-level command before address@hidden"),
$content->{'cmdname'}), $content->{'line_nr'});
}
} else {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"lowering the section level of address@hidden appearing
after a lower element"),
$content->{'cmdname'}), $content->{'line_nr'});
$content->{'level'} = $up->{'level'} + 1;
@@ -303,7 +305,7 @@
}
} elsif ($content->{'cmdname'} eq 'part'
and !$content->{'extra'}->{'part_associated_section'}) {
- $self->line_warn(sprintf($self->__(
+ $self->line_warn(sprintf(__(
"no sectioning command associated with address@hidden"),
$content->{'cmdname'}), $content->{'line_nr'});
}
@@ -332,7 +334,7 @@
if ($global_commands->{'part'}) {
foreach my $part (@{$global_commands->{'part'}}) {
if (!Texinfo::Common::is_content_empty($part)) {
- $self->line_warn(sprintf($self->__("address@hidden not empty"),
+ $self->line_warn(sprintf(__("address@hidden not empty"),
$part->{'cmdname'}), $part->{'line_nr'});
}
}
@@ -388,7 +390,7 @@
my $menu_node = $self->{'labels'}->{$normalized_menu_node};
if (!$menu_node) {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("address@hidden reference to nonexistent node `%s'"), $command,
node_extra_to_texi($menu_content->{'extra'}->{'menu_entry_node'})),
$menu_content->{'line_nr'});
@@ -395,7 +397,7 @@
} else {
if (!_check_node_same_texinfo_code($menu_node,
$menu_content->{'extra'}->{'menu_entry_node'})) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("address@hidden entry node name `%s' different from %s name `%s'"),
$command,
node_extra_to_texi($menu_content->{'extra'}->{'menu_entry_node'}),
@@ -439,7 +441,7 @@
if ($node->{'menus'}) {
if ($self->{'SHOW_MENU'} and @{$node->{'menus'}} > 1) {
foreach my $menu (@{$node->{'menus'}}[1 .. $#{$node->{'menus'}}]) {
- $self->line_warn(sprintf($self->__("multiple address@hidden"),
+ $self->line_warn(sprintf(__("multiple address@hidden"),
$menu->{'cmdname'}), $menu->{'line_nr'});
}
}
@@ -515,7 +517,7 @@
if ($self->{'SHOW_MENU'}
and $self->{'validatemenus'}
and $node ne $top_node and !$node->{'menu_up'}) {
- $self->line_warn(sprintf($self->__("unreferenced node `%s'"),
+ $self->line_warn(sprintf(__("unreferenced node `%s'"),
node_extra_to_texi($node->{'extra'})), $node->{'line_nr'});
}
@@ -565,7 +567,7 @@
and @{$section->{'section_up'}{'extra'}{'associated_node'}{'menus'}}
or $self->{'validatemenus'})
and !$node->{'menu_'.$direction}) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("node `%s' is %s for `%s' in sectioning but not in menu"),
node_extra_to_texi($node->{'node_'.$direction}->{'extra'}),
$direction,
@@ -574,7 +576,7 @@
} elsif ($node->{'menu_'.$direction}
and $node->{'menu_'.$direction}
ne $node->{'node_'.$direction}) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("node %s `%s' in menu `%s' and in sectioning `%s'
differ"),
$direction,
node_extra_to_texi($node->{'extra'}),
@@ -592,7 +594,7 @@
if ($node->{'menu_'.$direction}
and !$node->{'menu_'.$direction}->{'extra'}->{'manual_content'})
{
if ($self->{'SHOW_MENU'} and
$node->{'extra'}->{'associated_section'}) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("node `%s' is %s for `%s' in menu but not in
sectioning"),
node_extra_to_texi($node->{'menu_'.$direction}->{'extra'}),
$direction,
@@ -647,7 +649,7 @@
if (!$self->{'info'}->{'novalidate'}
and !_check_node_same_texinfo_code($node_target,
$node_direction)) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("%s pointer `%s' (for node `%s') different from %s name
`%s'"),
$direction_texts{$direction},
node_extra_to_texi($node_direction),
@@ -671,7 +673,7 @@
$node->{'node_'.$direction}->{'extra'}->{'top_node_up'}
= $node;
} else {
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("%s reference to nonexistent `%s'"),
$direction_texts{$direction},
node_extra_to_texi($node_direction)), $node->{'line_nr'});
@@ -692,7 +694,7 @@
or $self->{'validatemenus'})
and !$node->{'node_up'}->{'extra'}->{'manual_content'}) {
# up node is a real node but has no menu entry
- $self->line_error(sprintf($self->
+ $self->line_error(sprintf(
__("node `%s' lacks menu item for `%s' despite being its Up
target"),
node_extra_to_texi($node->{'node_up'}->{'extra'}),
node_extra_to_texi($node->{'extra'})),
@@ -700,7 +702,7 @@
# This leads to an error when there is an external nodes as up, and
# not in Top node.
} elsif ($node->{'menu_up'}) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("for `%s', up in menu `%s' and up `%s' don't match"),
node_extra_to_texi($node->{'extra'}),
node_extra_to_texi($node->{'menu_up'}->{'extra'}),
@@ -1210,7 +1212,7 @@
}
if (!defined($labels->{$node_arg->{'normalized'}})) {
if (!$self->{'info'}->{'novalidate'}) {
- $self->line_error(sprintf($self->__("address@hidden reference to
nonexistent node `%s'"),
+ $self->line_error(sprintf(__("address@hidden reference to nonexistent
node `%s'"),
$ref->{'cmdname'}, node_extra_to_texi($node_arg)),
$ref->{'line_nr'});
}
@@ -1219,7 +1221,7 @@
$ref->{'extra'}->{'label'} = $node_target;
if (!$self->{'info'}->{'novalidate'}
and !_check_node_same_texinfo_code($node_target, $node_arg)) {
- $self->line_warn(sprintf($self->
+ $self->line_warn(sprintf(
__("address@hidden to `%s', different from %s name `%s'"),
$ref->{'cmdname'},
node_extra_to_texi($node_arg),
@@ -1472,7 +1474,7 @@
}
}
if ($entry->{'key'} !~ /\S/) {
- $self->line_warn(sprintf($self->__("empty index key in
address@hidden"),
+ $self->line_warn(sprintf(__("empty index key in address@hidden"),
$entry->{'index_at_command'}),
$entry->{'command'}->{'line_nr'});
}
Modified: trunk/tp/t/test_utils.pl
===================================================================
--- trunk/tp/t/test_utils.pl 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/t/test_utils.pl 2018-08-12 19:01:17 UTC (rev 8045)
@@ -84,7 +84,9 @@
if (! defined($localesdir)) {
warn "No locales directory found, some tests will fail\n";
}
+
Locale::Messages::bindtextdomain ('texinfo_document', $localesdir);
+Locale::Messages::bindtextdomain ('texinfo', $localesdir);
my $generated_texis_dir = 't_texis';
Modified: trunk/tp/texi2any.pl
===================================================================
--- trunk/tp/texi2any.pl 2018-08-10 18:37:08 UTC (rev 8044)
+++ trunk/tp/texi2any.pl 2018-08-12 19:01:17 UTC (rev 8045)
@@ -179,17 +179,6 @@
$strings_textdomain = 'texinfo_document'
if ($strings_textdomain eq '@'.'PACKAGE@' . '_document');
-sub __($) {
- my $msgid = shift;
- return Locale::Messages::dgettext($messages_textdomain, $msgid);
-}
-
-sub __p($$) {
- my $context = shift;
- my $msgid = shift;
- return Locale::Messages::dpgettext($messages_textdomain, $context, $msgid);
-}
-
my $srcdir;
if (defined($ENV{'top_srcdir'})) {
$srcdir = File::Spec->catdir($ENV{'top_srcdir'}, 'tp');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8045] do not call gettext as a method on a parser object,
gavinsmith0123 <=