[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Tue, 8 Nov 2022 03:29:24 -0500 (EST) |
branch: master
commit 5eb1f1d396fa2bd5186ca6b83b77a3ea3608b010
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Oct 31 09:51:02 2022 +0100
* tp/Texinfo/Config.pm (texinfo_register_direction_string_info):
set converted string structure only if the argument is defined.
---
ChangeLog | 5 +++++
tp/Texinfo/Config.pm | 10 ++++++----
tp/t/init/translated_strings_customization.pm | 18 ++++++++++++++++++
.../results/init_files_tests/customize_translations.pl | 8 ++++----
4 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ae33f9f8e7..08412501cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-10-31 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Config.pm (texinfo_register_direction_string_info):
+ set converted string structure only if the argument is defined.
+
2022-10-30 Patrice Dumas <pertusus@free.fr>
* doc/texi2any_api.texi (Direction Strings Customization)
diff --git a/tp/Texinfo/Config.pm b/tp/Texinfo/Config.pm
index cb7603edc2..928431807d 100644
--- a/tp/Texinfo/Config.pm
+++ b/tp/Texinfo/Config.pm
@@ -685,10 +685,12 @@ sub texinfo_register_direction_string_info($$;$$$)
if (not exists($GNUT_direction_string_info->{$type}->{$direction}));
$GNUT_direction_string_info->{$type}->{$direction}->{'to_convert'}
= $string_to_convert;
- $GNUT_direction_string_info->{$type}->{$direction}->{'converted'} = {}
- if
(!defined($GNUT_direction_string_info->{$type}->{$direction}->{'converted'}));
- $GNUT_direction_string_info->{$type}->{$direction}->{'converted'}->{$context}
- = $converted_string;
+ if (defined($converted_string)) {
+ $GNUT_direction_string_info->{$type}->{$direction}->{'converted'} = {}
+ if
(!defined($GNUT_direction_string_info->{$type}->{$direction}->{'converted'}));
+
$GNUT_direction_string_info->{$type}->{$direction}->{'converted'}->{$context}
+ = $converted_string;
+ }
}
sub GNUT_get_direction_string_info()
diff --git a/tp/t/init/translated_strings_customization.pm
b/tp/t/init/translated_strings_customization.pm
index 1e8695f266..016ca88a1a 100644
--- a/tp/t/init/translated_strings_customization.pm
+++ b/tp/t/init/translated_strings_customization.pm
@@ -20,6 +20,7 @@ my %translations = (
' -> ' => {'' => 'Nœ suivant'},
'error-->' => {'' => 'Erreur-->',},
+ 'Forward' => {'' => 'Vers l\'avant @result{}',},
'Table of contents' => {'' => 'La @emph{Table des mati@`eres}',},
'{number} {section_title}' => {'' => '{number}@ : {section_title}'},
},
@@ -28,6 +29,7 @@ my %translations = (
' -> ' => {'' => 'Nächster Knoten'},
'error-->' => {'' => 'Fehler-->',},
+ 'Forward' => {'' => 'Nach vorne @result{}',},
'Table of contents' => {'' => 'Das @emph{Inhaltsverzeichnis}',},
'{number} {section_title}' => {'' => '{number}: {section_title}'},
},
@@ -51,4 +53,20 @@ sub _my_format_translate_string($$$;$$$)
texinfo_register_formatting_function('format_translate_string',
\&_my_format_translate_string);
+# avoid doing twice if there are more than one manual processed
+my $button_added;
+sub _my_add_button
+{
+ my ($self, $tree, $stage) = @_;
+
+ if (!$button_added) {
+ my @section_buttons = @{$self->get_conf('SECTION_BUTTONS')};
+ push @section_buttons, (' ', 'Forward');
+ $self->set_conf('SECTION_BUTTONS', \@section_buttons);
+ $button_added = 1;
+ }
+}
+
+texinfo_register_handler('setup', \&_my_add_button);
+
1;
diff --git a/tp/t/results/init_files_tests/customize_translations.pl
b/tp/t/results/init_files_tests/customize_translations.pl
index ef406821bd..a11a996ea6 100644
--- a/tp/t/results/init_files_tests/customize_translations.pl
+++ b/tp/t/results/init_files_tests/customize_translations.pl
@@ -860,7 +860,7 @@ ul.toc-numbered-mark {list-style: none}
<div class="chapter-level-extent" id="Chapter">
<div class="nav-panel">
<p>
- -> : <a href="#Chapter-fr" accesskey="n" rel="next">chap fr</a>, Previous:
<a href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top"
accesskey="u" rel="up">top</a> [<a href="#SEC_Contents" title="Table of
contents" rel="contents">Contents</a>]</p>
+ -> : <a href="#Chapter-fr" accesskey="n" rel="next">chap fr</a>, Previous:
<a href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top"
accesskey="u" rel="up">top</a> [<a href="#SEC_Contents" title="Table of
contents" rel="contents">Contents</a>] [<a href="#Chapter-fr"
title="Next section in reading order" accesskey="n" rel="next">Forward</a>]</p>
</div>
<h2 class="chapter" id="chap">1 chap</h2>
@@ -871,7 +871,7 @@ ul.toc-numbered-mark {list-style: none}
<div class="chapter-level-extent" id="Chapter-fr">
<div class="nav-panel">
<p>
-Nœ suivant: <a href="#Chapter-de" accesskey="n" rel="next">chap de</a>,
Précédent: <a href="#Chapter" accesskey="p" rel="prev">chap</a>,
Monter: <a href="#Top" accesskey="u" rel="up">top</a> [<a
href="#SEC_Contents" title="La Table des matières" rel="contents">Table
des matières</a>]</p>
+Nœ suivant: <a href="#Chapter-de" accesskey="n" rel="next">chap de</a>,
Précédent: <a href="#Chapter" accesskey="p" rel="prev">chap</a>,
Monter: <a href="#Top" accesskey="u" rel="up">top</a> [<a
href="#SEC_Contents" title="La Table des matières" rel="contents">Table
des matières</a>] [<a href="#Chapter-de" title="Section suivante
dans l’ordre de lecture" accesskey="n" rel="next">Vers l’avant
⇒</a>]</p>
</div>
<h2 class="chapter" id="chap-fr">2 chap fr</h2>
@@ -882,7 +882,7 @@ Nœ suivant: <a href="#Chapter-de" accesskey="n"
rel="next">chap de</a>, Pr
<div class="chapter-level-extent" id="Chapter-de">
<div class="nav-panel">
<p>
-Nächster Knoten: <a href="#Last-chapter" accesskey="n" rel="next">Last
Chapter</a>, Vorige: <a href="#Chapter-fr" accesskey="p" rel="prev">chap
fr</a>, Nach oben: <a href="#Top" accesskey="u" rel="up">top</a> [<a
href="#SEC_Contents" title="Das Inhaltsverzeichnis"
rel="contents">Inhalt</a>]</p>
+Nächster Knoten: <a href="#Last-chapter" accesskey="n" rel="next">Last
Chapter</a>, Vorige: <a href="#Chapter-fr" accesskey="p" rel="prev">chap
fr</a>, Nach oben: <a href="#Top" accesskey="u" rel="up">top</a> [<a
href="#SEC_Contents" title="Das Inhaltsverzeichnis" rel="contents">Inhalt</a>]
[<a href="#Last-chapter" title="Nächster Abschnitt in Lesereihenfolge"
accesskey="n" rel="next">Nach vorne ⇒</a>]</p>
</div>
<h2 class="chapter" id="chap-de">3 chap de</h2>
@@ -893,7 +893,7 @@ Nächster Knoten: <a href="#Last-chapter" accesskey="n"
rel="next">Last Chapter<
<div class="chapter-level-extent" id="Last-chapter">
<div class="nav-panel">
<p>
-Vorige: <a href="#Chapter-de" accesskey="p" rel="prev">chap de</a>, Nach oben:
<a href="#Top" accesskey="u" rel="up">top</a> [<a href="#SEC_Contents"
title="Das Inhaltsverzeichnis" rel="contents">Inhalt</a>]</p>
+Vorige: <a href="#Chapter-de" accesskey="p" rel="prev">chap de</a>, Nach oben:
<a href="#Top" accesskey="u" rel="up">top</a> [<a href="#SEC_Contents"
title="Das Inhaltsverzeichnis" rel="contents">Inhalt</a>] </p>
</div>
<h2 class="chapter" id="Last-Chapter">4 Last Chapter</h2>
- master updated (183227df2e -> 2dff71c663), Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject],
Patrice Dumas <=
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08
- [no subject], Patrice Dumas, 2022/11/08