texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/Info.pm (output) <Local Vari


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/Info.pm (output) <Local Variables>: Output "Info-documentlanguage" if available. * doc/texinfo.texi (Info Format Local Variables): update * NEWS: mention
Date: Sun, 31 Dec 2023 10:15:38 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 85091d47fa * tp/Texinfo/Convert/Info.pm (output) <Local Variables>: 
Output "Info-documentlanguage" if available. * doc/texinfo.texi (Info Format 
Local Variables): update * NEWS: mention
85091d47fa is described below

commit 85091d47fa97454fdc612b74b730d648409c4dcf
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Dec 31 15:14:49 2023 +0000

    * tp/Texinfo/Convert/Info.pm (output) <Local Variables>:
    Output "Info-documentlanguage" if available.
    * doc/texinfo.texi (Info Format Local Variables): update
    * NEWS: mention
---
 ChangeLog                                             |   7 +++++++
 NEWS                                                  |   2 ++
 doc/texinfo.texi                                      |  14 ++++++++++----
 tp/Texinfo/Convert/Info.pm                            |  13 +++++++++++--
 .../res_info/japanese_shift_jis.info                  |   1 +
 .../res_info/multiple_include_encodings.info          | Bin 5464 -> 5490 bytes
 tp/t/results/languages/appendix_translated.pl         |   1 +
 tp/t/results/languages/command_translated.pl          |   1 +
 .../documentlanguage/res_info/documentlanguage.info   | Bin 556 -> 582 bytes
 .../res_info/documentlanguage.info                    | Bin 556 -> 582 bytes
 .../res_info/documentlanguage.info                    | Bin 553 -> 584 bytes
 tp/t/results/languages/multiple_documentlanguage.pl   |   1 +
 tp/t/results/languages/multiple_in_preamble.pl        |   1 +
 .../languages/multiple_in_preamble_before_node.pl     |   1 +
 .../res_info/multiple_lang_chapters.info              |   1 +
 .../res_info/multiple_lang_chapters.info              |   1 +
 tp/t/results/languages/unknown_language.pl            |   1 +
 tp/t/results/languages/unknown_region.pl              |   1 +
 tp/t/results/transformations/master_menu_fr.pl        |   1 +
 .../res_parser/formatting_fr_info/formatting.info     |   1 +
 20 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7b74050c0f..a29c552159 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-12-31  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Info.pm (output) <Local Variables>:
+       Output "Info-documentlanguage" if available.
+       * doc/texinfo.texi (Info Format Local Variables): update
+       * NEWS: mention
+
 2023-12-31  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Converter.pm (float_name_caption): rename
diff --git a/NEWS b/NEWS
index 0e0d4f054d..da9070dc49 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ See the manual for detailed information.
    new enough texi2dvi (Texinfo 6.7, 2019) for index files to be properly
    processed.
 * texi2any
+ . info output: output Info-documentlanguage in Local Variables section
+   of output file if @documentlanguage is given
  . remove SIMPLE_MENU customization option and tree transformation.
  . remove FRAMES and FRAMESET_DOCTYPE customization options.
  . rename PACKAGE* customization variables to PACKAGE*_OPTION.  For example
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index b5491f6199..1c4b81744d 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -23476,18 +23476,24 @@ table entry.
 
 @cindex Local variable section, in Info format
 
-The local variables section is optional and is currently used to give the
-encoding information.  It may be augmented in the future.
+The local variables section is optional.  It is currently used to give
+the encoding information and/or the document language code.
 
 @example
     <local variables> =
 <separator>
 Local Variables:
-coding: <encoding>
+(coding: <encoding>)?
+(Info-documentlanguage: <language>)?
 End:
 @end example
 
-@xref{@code{@@documentencoding}}.
+@xref{@code{@@documentencoding}} for information about the document encoding.
+
+@samp{<language>} should be of the form @var{ll} or @var{ll}_@var{cc}; see
+@ref{@code{@@documentlanguage}}.  Only one language can be specified
+in the local variables section even if @code{@@documentlanguage} occurs
+several times in a Texinfo document.
 
 
 @node Info Format Regular Nodes
diff --git a/tp/Texinfo/Convert/Info.pm b/tp/Texinfo/Convert/Info.pm
index 8bce249c90..a859bb88c9 100644
--- a/tp/Texinfo/Convert/Info.pm
+++ b/tp/Texinfo/Convert/Info.pm
@@ -285,9 +285,18 @@ sub output($$)
     $tag_text .=  "$prefix: $label_text\x{7F}$label->{'bytes'}\n";
   }
   $tag_text .=  "\x{1F}\nEnd Tag Table\n";
+
   my $coding = $self->get_conf('OUTPUT_ENCODING_NAME');
-  if ($coding) {
-    $tag_text .= "\n\x{1F}\nLocal Variables:\ncoding: $coding\nEnd:\n";
+  my $documentlanguage = $self->get_conf('documentlanguage');
+
+  if ($coding or $documentlanguage) {
+    # Note: Info readers expect the Local Variables section to be
+    # under 1000 bytes in length so not many variables can be added here.
+    $tag_text .= "\n\x{1F}\nLocal Variables:\n";
+    $tag_text .= "coding: $coding\n" if $coding;
+    $tag_text .= "Info-documentlanguage: $documentlanguage\n"
+      if $documentlanguage;
+    $tag_text .= "End:\n";
   }
   if ($fh) {
     print $fh $tag_text;
diff --git 
a/tp/t/results/formats_encodings/japanese_shift_jis/res_info/japanese_shift_jis.info
 
b/tp/t/results/formats_encodings/japanese_shift_jis/res_info/japanese_shift_jis.info
index 3b00b7dc3a..7dbb41df2c 100644
--- 
a/tp/t/results/formats_encodings/japanese_shift_jis/res_info/japanese_shift_jis.info
+++ 
b/tp/t/results/formats_encodings/japanese_shift_jis/res_info/japanese_shift_jis.info
@@ -60,4 +60,5 @@ End Tag Table
 
 Local Variables:
 coding: shift_jis
+Info-documentlanguage: ja
 End:
diff --git 
a/tp/t/results/formats_encodings/multiple_include_encodings/res_info/multiple_include_encodings.info
 
b/tp/t/results/formats_encodings/multiple_include_encodings/res_info/multiple_include_encodings.info
index 9640f7813d..77b68bcff2 100644
Binary files 
a/tp/t/results/formats_encodings/multiple_include_encodings/res_info/multiple_include_encodings.info
 and 
b/tp/t/results/formats_encodings/multiple_include_encodings/res_info/multiple_include_encodings.info
 differ
diff --git a/tp/t/results/languages/appendix_translated.pl 
b/tp/t/results/languages/appendix_translated.pl
index a44ceb9672..ca82387121 100644
--- a/tp/t/results/languages/appendix_translated.pl
+++ b/tp/t/results/languages/appendix_translated.pl
@@ -295,6 +295,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: es
 End:
 ';
 
diff --git a/tp/t/results/languages/command_translated.pl 
b/tp/t/results/languages/command_translated.pl
index a2f0873ae9..9ccc704225 100644
--- a/tp/t/results/languages/command_translated.pl
+++ b/tp/t/results/languages/command_translated.pl
@@ -397,6 +397,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: fr
 End:
 ';
 
diff --git 
a/tp/t/results/languages/documentlanguage/res_info/documentlanguage.info 
b/tp/t/results/languages/documentlanguage/res_info/documentlanguage.info
index 83f280a7c6..16e04fa4e4 100644
Binary files 
a/tp/t/results/languages/documentlanguage/res_info/documentlanguage.info and 
b/tp/t/results/languages/documentlanguage/res_info/documentlanguage.info differ
diff --git 
a/tp/t/results/languages/documentlanguage_option/res_info/documentlanguage.info 
b/tp/t/results/languages/documentlanguage_option/res_info/documentlanguage.info
index 5a0ce188e0..699ee3c9af 100644
Binary files 
a/tp/t/results/languages/documentlanguage_option/res_info/documentlanguage.info 
and 
b/tp/t/results/languages/documentlanguage_option/res_info/documentlanguage.info 
differ
diff --git 
a/tp/t/results/languages/documentlanguage_unknown/res_info/documentlanguage.info
 
b/tp/t/results/languages/documentlanguage_unknown/res_info/documentlanguage.info
index 5eba613a0f..6dd497c50f 100644
Binary files 
a/tp/t/results/languages/documentlanguage_unknown/res_info/documentlanguage.info
 and 
b/tp/t/results/languages/documentlanguage_unknown/res_info/documentlanguage.info
 differ
diff --git a/tp/t/results/languages/multiple_documentlanguage.pl 
b/tp/t/results/languages/multiple_documentlanguage.pl
index 8fbd40bc0c..c5ebf7fc98 100644
--- a/tp/t/results/languages/multiple_documentlanguage.pl
+++ b/tp/t/results/languages/multiple_documentlanguage.pl
@@ -1213,6 +1213,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: hr
 End:
 ';
 
diff --git a/tp/t/results/languages/multiple_in_preamble.pl 
b/tp/t/results/languages/multiple_in_preamble.pl
index c89cf44b8d..1a31ada553 100644
--- a/tp/t/results/languages/multiple_in_preamble.pl
+++ b/tp/t/results/languages/multiple_in_preamble.pl
@@ -1070,6 +1070,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: de
 End:
 ';
 
diff --git a/tp/t/results/languages/multiple_in_preamble_before_node.pl 
b/tp/t/results/languages/multiple_in_preamble_before_node.pl
index 1cc7611ee9..4874890649 100644
--- a/tp/t/results/languages/multiple_in_preamble_before_node.pl
+++ b/tp/t/results/languages/multiple_in_preamble_before_node.pl
@@ -911,6 +911,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: de
 End:
 ';
 
diff --git 
a/tp/t/results/languages/multiple_lang_chapters/res_info/multiple_lang_chapters.info
 
b/tp/t/results/languages/multiple_lang_chapters/res_info/multiple_lang_chapters.info
index 2bd7e80469..82a0aa04fc 100644
--- 
a/tp/t/results/languages/multiple_lang_chapters/res_info/multiple_lang_chapters.info
+++ 
b/tp/t/results/languages/multiple_lang_chapters/res_info/multiple_lang_chapters.info
@@ -69,4 +69,5 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: pt_BR
 End:
diff --git 
a/tp/t/results/languages/multiple_lang_chapters_texi2html/res_info/multiple_lang_chapters.info
 
b/tp/t/results/languages/multiple_lang_chapters_texi2html/res_info/multiple_lang_chapters.info
index 2bd7e80469..82a0aa04fc 100644
--- 
a/tp/t/results/languages/multiple_lang_chapters_texi2html/res_info/multiple_lang_chapters.info
+++ 
b/tp/t/results/languages/multiple_lang_chapters_texi2html/res_info/multiple_lang_chapters.info
@@ -69,4 +69,5 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: pt_BR
 End:
diff --git a/tp/t/results/languages/unknown_language.pl 
b/tp/t/results/languages/unknown_language.pl
index d11bc82225..7fb12260e1 100644
--- a/tp/t/results/languages/unknown_language.pl
+++ b/tp/t/results/languages/unknown_language.pl
@@ -502,6 +502,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: another_UNKNOWN
 End:
 ';
 
diff --git a/tp/t/results/languages/unknown_region.pl 
b/tp/t/results/languages/unknown_region.pl
index d6f4e82a52..51ec99ad72 100644
--- a/tp/t/results/languages/unknown_region.pl
+++ b/tp/t/results/languages/unknown_region.pl
@@ -388,6 +388,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: fr_NOWHERE
 End:
 ';
 
diff --git a/tp/t/results/transformations/master_menu_fr.pl 
b/tp/t/results/transformations/master_menu_fr.pl
index 5f9f2dceea..45034b9a02 100644
--- a/tp/t/results/transformations/master_menu_fr.pl
+++ b/tp/t/results/transformations/master_menu_fr.pl
@@ -873,6 +873,7 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: fr
 End:
 ';
 
diff --git a/tp/tests/layout/res_parser/formatting_fr_info/formatting.info 
b/tp/tests/layout/res_parser/formatting_fr_info/formatting.info
index a970ab1cef..e35d6e47f8 100644
--- a/tp/tests/layout/res_parser/formatting_fr_info/formatting.info
+++ b/tp/tests/layout/res_parser/formatting_fr_info/formatting.info
@@ -3713,4 +3713,5 @@ End Tag Table
 
 Local Variables:
 coding: utf-8
+Info-documentlanguage: fr
 End:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]