[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is @emph{See} translatable?
From: |
Petr Pisar |
Subject: |
Re: Is @emph{See} translatable? |
Date: |
Thu, 28 Sep 2023 11:00:44 +0200 |
V Wed, Sep 27, 2023 at 07:25:20PM +0100, Gavin Smith napsal(a):
> On Tue, Sep 26, 2023 at 09:53:38PM +0100, Gavin Smith wrote:
>
> An alternative approach is to attempt to change the invocation of msgfmt,
> perhaps omitting options such as --check. However, Petr implied in his
> message that the TP places restrictions on uploading translation files
> if they would lead to such errors:
>
The truth is that I believe that TP places the restrictions. I use --check
option locally. That's how I find out the problem. Then I looked at other,
already translated languages and find out they also did not translate "See".
Hence I believe the translators hit the same problem, probably becaue TP
places the restriction.
> > For this time, I kept the strings untranslated to be able to upload the
> > translation.
>
> so this is a non-starter. (It's also mysterious to me how to alter the
> operation of "make update-po" and whatever po_document/Makefile.in.in
> is/does.)
>
xgettext supports a markup in the code to explicitly specify what formatting
syntax is expected. One can use it do disable the check at a specific message.
I gave it a try:
--- texinfo-7.0.92.old/tp/Texinfo/Convert/HTML.pm 2023-09-13
19:35:41.000000000 +0200
+++ texinfo-7.0.92.new/tp/Texinfo/Convert/HTML.pm 2023-09-28
10:35:39.711916514 +0200
@@ -5666,6 +5666,9 @@
if ($in_code) {
$result_tree
# TRANSLATORS: redirect to another index entry
+ # TRANSLATORS: {main_index_entry} and {seenentry}
identifiers should
+ # not be translated.
+ # xgettext:no-perl-brace-format
= $self->gdt('@code{{main_index_entry}}, @emph{See}
@code{{seenentry}}',
{'main_index_entry' => $entry_ref_tree,
'seenentry' => $referred_tree});
A result looks like this:
#. TRANSLATORS: redirect to another index entry
#. TRANSLATORS: {main_index_entry} and {seenentry} identifiers should
#. not be translated.
#: tp/Texinfo/Convert/HTML.pm:5672
#, no-perl-brace-format
msgid "@code{{main_index_entry}}, @emph{See} @code{{seenentry}}"
And together with a translated string:
msgstr "@code{{main_index_entry}}, @emph{Vizte} @code{{seenentry}}"
It passes msgfmt --check.
I admin it's not perfect because one looses a syntax check for that message.
An ideal solution would require enhancing Locale::TextDomain to be able to
exempt a brace from a translation lookup. But I guess this out of scope fo
texinfo project.
-- Petr
signature.asc
Description: PGP signature