Re: Re: Re: Localized English words ('See', 'see', 'Short Table of Contents') (TeX output)
Jamenson Espindula <[email protected]> Thu, 5 Mar 2026 07:41:19 -0300
| Newsgroups | gmane.comp.tex.texinfo.general |
|---|---|
| Message-ID | <CAOW_YOnnfMTU0nJdZUZfdzu4hP1M6iQFy_2mTLUFbZM=YsE9_w@mail.gmail.com> |
Em qui., 5 de mar. de 2026 =C3=A0s 06:17, Patrice Dumas <[email protected]> = escreveu: > > On Thu, Mar 05, 2026 at 05:39:52AM -0300, Jamenson Espindula wrote: > > Below is the actual content of the 't2a_modify_translations.pm': > > > > =3D =3D =3D transcription begins =3D =3D =3D > > It would be much easier if you attached the file, and also it could > allow me to check the actual encoding. Once transcripted, some > information on the actual file, in particular how characters are > encoded is lost. > > > 1 > > > > 2 use strict; > > > > 3 use warnings; > > > > 4 use utf8 > > A ; is missing on the use utf8 line, which explains why you have an > error message below. Should be: > > use utf8; > > > > > 5 > > > > 6 my %translations =3D ( > > > > 7 'pt_BR' =3D> { > > > > 8 'error@arrow{}' =3D> {'' =3D> 'error@arrow{}'}, > > > > 9 'Next' =3D> {'NodeNext direction string' =3D> 'Pr=C3=B3xi= mo'}, > > > > 10 ' ' =3D> {'' =3D> ' '}, > > > > 11 'Table of contents' =3D> {'Contents direction description= ' > > =3D> 'Sum=C3=A1rio'}, > > > > 12 'Contents' =3D> {'Contents direction string' =3D> 'Conte= =C3=BAdo'}, > > > > 13 'Index' =3D> {'Index direction description' =3D> '=C3=8Dn= dice'}, > > > > 14 'Index' =3D> {'Index direction string' =3D> '=C3=8Dndice'= }, > > > > 15 ' ? ' =3D> {'' =3D> ' ? '}, > > > > 16 '{number} {section_title}' =3D> {'' =3D> '{number} {secti= on_title}'}, > > > > 17 'Appendix {number} {section_title}' =3D> {'' =3D> 'Anexo > > {number} {section_title}'}, > > > > 18 'Short Table of Contents' =3D> {'shortcontents section > > heading' =3D> 'Sumar=C3=ADssimo'}, > > > > 19 'Table of Contents' =3D> {'contents section heading' =3D>= 'Sum=C3=A1rio'}, > > > > 20 '{element_text} ({title})' =3D> {'' =3D> '{element_text} = ({title})'}, > > > > 21 'Previous' =3D> {'NodePrev direction string' =3D> 'Anteri= or'}, > > > > 22 'Up' =3D> {'NodeUp direction string' =3D> 'Acima'}, > > > > 23 'see {reference_name}' =3D> {'' =3D> 'veja-se {reference_= name}'}, > > > > 24 'See {reference_name}' =3D> {'' =3D> 'Veja-se {reference_= name}'}, > > > > 25 '{reference} in @cite{{book}}' =3D> {'' =3D> '{reference}= em > > @cite{{book}}'}, > > > > 26 'see @cite{{book_reference}}' =3D> {'' =3D> 'veja-se > > @cite{{book_reference}}'}, > > > > 27 'see {reference} in @cite{{book}}' =3D> {'' =3D> 'veja-se > > {reference} em @cite{{book}}'}, > > > > 28 '{reference_name}' =3D> {'' =3D> '{reference_name}'}, > > > > 29 'See @cite{{book_reference}}' =3D> {'' =3D> 'Veja-se > > @cite{{book_reference}}'}, > > > > 30 'See {reference} in @cite{{book}}' =3D> {'' =3D> 'Veja-se > > {reference} em @cite{{book}}'}, > > > > 31 'Footnotes' =3D> {'footnotes section heading' =3D> 'Notas= de Rodap=C3=A9'}, > > > > 32 '{explained_string} ({explanation})' =3D> {'' =3D> > > '{explained_string} ({explanation})'}, > > > > 33 '@b{{quotation_arg}:} ' =3D> {'' =3D> '@b{{quotation_arg}= :} '}, > > > > 34 '@center --- @emph{{author}}' =3D> {'' =3D> '@center --- > > @emph{{author}}'}, > > > > 35 '{category}: ' =3D> {'' =3D> '{category}: '}, > > > > 36 '{category} of @code{{class}}: ' =3D> {'' =3D> '{category= } > > da @code{{class}}: '}, > > > > 37 '@cite{{book_reference}}' =3D> {'' =3D> '@cite{{book_refe= rence}}'}, > > > > 38 'Jump to' =3D> {'' =3D> 'Pular para'}, > > > > 39 'The node you are looking for is at {href}.' =3D> {'' =3D= > > > 'O n=C3=B3 que voc=C3=AA est=C3=A1 procurando est=C3=A1 em {href}.'}, > > > > 40 'Index' =3D> {'Index direction description' =3D> '=C3=8Dn= dice'}, > > > > 41 'Function' =3D> {'category of functions for @defun' =3D> = 'Fun=C3=A7=C3=A3o'}, > > > > 42 'Special Form' =3D> {'' =3D> 'Forma Especial'}, > > > > 43 'Instance Variable' =3D> {'category of instance variables > > in object-oriented programming for @defivar' =3D> 'Vari=C3=A1vel de > > Inst=C3=A2ncia'}, > > > > 44 'Instance Variable' =3D> {'category of instance variables > > with data type in object-oriented programming for @deftypeivar' =3D> > > 'Vari=C3=A1vel de Inst=C3=A2ncia'}, > > > > 45 }, > > > > 46 ); > > > > 47 > > > > 48 my $seen_translated =3D {}; > > > > 49 my $translated_lang =3D 'pt_BR'; > > > > 50 > > > > 51 sub my_format_translate_message($$$;$) { > > > > 52 my ($converter, $string, $lang, $translation_context) =3D @_; > > > > 53 > > > > 54 $translation_context =3D '' if (!defined($translation_context))= ; > > > > 55 > > > > 56 # uncomment next lines to have the strings to translate being p= rinted > > > > 57 #if (!exists($seen_translated->{"$string-$translation_context"}= )) { > > > > 58 # if (!exists($translations{$translated_lang}) > > > > 59 # or !exists($translations{$translated_lang}->{$string}) > > > > 60 # or !exists($translations{$translated_lang}->{$string} > > > > 61 # ->{$translation_contex= t})) { > > > > 62 # print STDERR " # '$string' =3D> > > {'$translation_context' =3D> ''},\n"; > > > > 63 # } > > > > 64 # $seen_translated->{"$string-$translation_context"} =3D 1; > > > > 65 #} > > > > 66 > > > > 67 return $string if (!defined($lang) or $lang eq ''); > > > > 68 if (exists($translations{$lang}) > > > > 69 and exists($translations{$lang}->{$string}) > > > > 70 and > > exists($translations{$lang}->{$string}->{$translation_context})) { > > > > 71 my $translation =3D > > $translations{$lang}->{$string}->{$translation_context}; > > > > 72 return $translation; > > > > 73 } > > > > 74 return undef; > > > > 75 } > > > > 76 > > > > 77 texinfo_register_formatting_function('format_translate_message', > > > > 78 \&my_format_translate_m= essage); > > > > 79 > > > > 80 sub my_reset_seen_translated { > > > > 81 $seen_translated =3D {}; > > > > 82 > > > > 83 return 0; > > > > 84 } > > > > 85 > > > > 86 texinfo_register_handler('setup', \&my_reset_seen_translated); > > > > 87 > > > > 88 1; > > > > =3D =3D =3D transcription ends =3D =3D =3D > > > > Output of 'texi2any --html --init-file ./t2a_modify_translations.pm': > > > > =3D =3D =3D transcription begins =3D =3D =3D > > > > 1 texi2any: error parsing ./t2a_modify_translations.pm: Global > > symbol "%translations" requires explicit package name (did you forget > > to declare "my %translations"?) at ./t2a_modify_translations.pm line > > 68. > > > > 2 Global symbol "%translations" requires explicit package name > > (did you forget to declare "my %translations"?) at > > ./t2a_modify_translations.pm line 69. > > > > 3 Global symbol "%translations" requires explicit package name > > (did you forget to declare "my %translations"?) at > > ./t2a_modify_translations.pm line 70. > > > > 4 Global symbol "%translations" requires explicit package name > > (did you forget to declare "my %translations"?) at > > ./t2a_modify_translations.pm line 71. > > > > =3D =3D =3D transcription ends =3D =3D =3D > > > > > Also you need to make sure that the strings in > > > t2a_modify_translations.pm are actually UTF-8 encoded. > > > > > > > Output of 'LC_ALL=3DC file t2a_modify_translations.pm': > > > > t2a_modify_translations.pm: Unicode text, UTF-8 text, with CRLF line te= rminators > > What is your platform? If you are not on Windows, it would be strange > to have CRLF line terminators. > > > Output of '/usr/bin/perl --version': > > > > This is perl 5, version 42, subversion 0 (v5.42.0) built for > > x86_64-linux-thread-multi > > That is recent enough (even more than the one I use). > > -- > Pat !It works! Really, the problem was the lack of a semicolon (;) character after the 'use utf8' directive! Sorry. My bad. :) The words on the HTML pages are now well formed! Thank you very very much! Jamenson Espindula