[Po4a-devel] [po4a-Bugs][311647] Allow marking some paragraphs/phrases as not-for-translation

po4a-bugs at alioth.debian.org po4a-bugs at alioth.debian.org
Tue Feb 6 16:02:33 UTC 2018


po4a-Bugs item #311647 was changed at 06/02/2018 17:02 by Martin Quinson
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=410622&aid=311647&group_id=30267

>Status: Closed
Priority: 3
Submitted By: Michael Terry (mterry-guest)
Assigned to: Nobody (None)
Summary: Allow marking some paragraphs/phrases as not-for-translation 
Category: None
Group: None
Resolution: None


Initial Comment:
It would be nice if I could mark some paragraphs as untranslatable.

For example, say I have a docbook flie that lists a number of file paths as part of the documentation.  These paths (like ~/.cache) show up to be translated, but I don't want them to be.

Maybe some format-specific comment that po4a understands?  In the docbook example, the paragraph being preceded by <!-- po4a: ignore --> or something.

----------------------------------------------------------------------

>Comment By: Martin Quinson (mquinson)
Date: 06/02/2018 17:02

Message:
Migrated as https://github.com/mquinson/po4a/issues/77 thus closing.

----------------------------------------------------------------------

Comment By: Martin Quinson (mquinson)
Date: 30/03/2017 22:30

Message:
Just to be sure: in which modules would you need this feature, Michael?

Implementing it in Sgml may be particularly challenging so I'd prefer not to do that if you don't really need it. Is it enough if it works in Man?

Thanks for your patience,
Mt

----------------------------------------------------------------------

Comment By: Martin Quinson (mquinson)
Date: 30/03/2017 22:25

Message:
Just for the record, this feature is now implemented in the man module (see section "Hiding text from po4a" from Locale::Po4a::Man(3pm))

----------------------------------------------------------------------

Comment By: Michael Terry (mterry-guest)
Date: 29/07/2010 20:14

Message:
That would be fine.  I'd also be interested in similar syntax for man pages too.

----------------------------------------------------------------------

Comment By: Denis Barbier (barbier-guest)
Date: 29/07/2010 15:39

Message:
You are right, that would be nice.  The parser can cope with comments only if they are embedded within a paragraph, which means that in XML one has to write <para><!-- Hey translator -->Foo bar</para> to have this comment printed into PO files.
One could indeed define special comments, e.g. <para><!-- po4a: ignore -->Foo bar</para> to have a paragraph copied verbatim into translated documents.  Note that these comments will not be removed from translated documents, I believe that this is fine.
You can test by editing Locale/Po4a/Xml.pm like this: replace
  if ($translate ne "")
by
  if ($translate ne "" && !(defined($comments) && $comments =~ m/^\s*po4a:\s*ignore/s))
I will commit this change unless you report problems with it.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=410622&aid=311647&group_id=30267



More information about the Po4a-devel mailing list