[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (converter_initializ
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (converter_initialize) (_reset_unset_no_arg_commands_formatting_context): do not remove converter translated commands default informations, but have translated formatted strings take precedence. |
Date: |
Sun, 23 Jan 2022 08:35:17 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new b28108ddef * tp/Texinfo/Convert/HTML.pm (converter_initialize)
(_reset_unset_no_arg_commands_formatting_context): do not remove converter
translated commands default informations, but have translated formatted strings
take precedence.
b28108ddef is described below
commit b28108ddefbe2a8799645b3ed651f487f5309240
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 23 14:35:06 2022 +0100
* tp/Texinfo/Convert/HTML.pm (converter_initialize)
(_reset_unset_no_arg_commands_formatting_context): do not remove
converter translated commands default informations, but have
translated formatted strings take precedence.
---
ChangeLog | 7 +++++++
tp/Texinfo/Convert/HTML.pm | 29 ++++++++++-------------------
2 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a48eb340d5..eb18d26194 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-01-23 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (converter_initialize)
+ (_reset_unset_no_arg_commands_formatting_context): do not remove
+ converter translated commands default informations, but have
+ translated formatted strings take precedence.
+
2022-01-23 Patrice Dumas <pertusus@free.fr>
Consistent interface and caching for translated brace no args commands
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 9ee643509e..d4e17843a5 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -6121,25 +6121,23 @@ sub
_reset_unset_no_arg_commands_formatting_context($$$$;$)
if (!defined
($self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname})) {
$self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname}->{'unset'}
= 1;
}
+ my $no_arg_command_context
+ = $self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname};
if (defined($ref_context)) {
- if
($self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname}->{'unset'})
{
+ if ($no_arg_command_context->{'unset'}) {
foreach my $key
(keys(%{$self->{'no_arg_commands_formatting'}->{$ref_context}->{$cmdname}})) {
- # FIXME leave translated?
-
$self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname}->{$key}
+ # both 'translated' and (possibly translated) 'text' are
+ # reused
+ $no_arg_command_context->{$key}
=
$self->{'no_arg_commands_formatting'}->{$ref_context}->{$cmdname}->{$key}
}
}
}
- # FIXME check that there is no 'translated' already?
- # it should not happen given how the defaults are set to exclude
- # converter default translation if translated is seen, but it may
- # not be very clean as it would mean that the translated string
- # specified by 'translated' is overwritten if there is also
- # a default translation.
if ($translate
- and
$self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname}->{'tree'}) {
+ and $no_arg_command_context->{'tree'}
+ and not defined($no_arg_command_context->{'translated'})) {
my $translated_tree
- =
$self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname}->{'tree'};
+ = $no_arg_command_context->{'tree'};
my $translation_result;
if ($reset_context eq 'normal') {
$translation_result
@@ -6164,7 +6162,7 @@ sub
_reset_unset_no_arg_commands_formatting_context($$$$;$)
} elsif ($reset_context eq 'css_string') {
$translation_result = $self->html_convert_css_string($translated_tree);
}
-
$self->{'no_arg_commands_formatting'}->{$reset_context}->{$cmdname}->{'text'}
+ $no_arg_command_context->{'text'}
= $translation_result;
}
}
@@ -6608,13 +6606,6 @@ sub converter_initialize($)
$self->{'no_arg_commands_formatting'}->{$context}->{$command}->{'unset'} = 1;
}
}
- if ($self->{'translated_commands'}->{$command}
- and
exists($self->{'no_arg_commands_formatting'}->{$context}->{$command}->{'translated'}))
{
- # FIXME check that the modification is to a copy and not the default
config
- # FIXME another possibility would be to use the default, but
- # override if 'translated' is set.
- delete $self->{'translated_commands'}->{$command};
- }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (converter_initialize) (_reset_unset_no_arg_commands_formatting_context): do not remove converter translated commands default informations, but have translated formatted strings take precedence.,
Patrice Dumas <=