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

Re: angle brackets in po files

On Sun, Mar 09, 2008 at 01:30:25PM +0000, Ian Jackson wrote:
> --- a/man/po/sv.po$
> +++ b/man/po/sv.po$
> @@ -11631,7 +11631,7 @@ msgstr ""$
> -"kommandot (I<anvM-CM-$ndare>B<:>I<grupp). Om du anger en anvM-CM-$ndare utan att "$
> +"kommandot (I<anvM-CM-$ndare>B<:>I<grupp>). Om du anger en anvM-CM-$ndare utan att "$
> Now it is definitely the case that the old text was wrong and the new
> text was correct.
> But is it really true that mismatched angle brackets aren't allowed in
> po files ?  I got an error complaining about the mismatch from an i18n
> processor.  (Sadly I forgot to keep a copy of the error mesage.)
> Are angle brackets syntactic somehow ?  If so why are they being used
> freely as textual things here ?

As Peter says, this is just for manual page translations via po4a. See
Locale::Po4a::Man(3pm) for details.

The B<...>, I<...>, etc. representations correspond to *roff input text
like this:

  .RI ( användare
  .B :
  .IR grupp ).
  Om du anger en användare utan att

(This is just a guess; obviously there are a number of different ways to
encode this.)

If you have an English sentence interspersed with font escapes, then of
course it may be the case that a translation of that sentence into some
other language will need to have the words in some other order and so
the font escapes will need to be rearranged to match. Thus, just
stripping out all the escapes and translating chunk-by-chunk won't work.
Rather than making every translator learn *roff and ensure all the line
breaks are in the right place (which I suspect translation tools often
don't make straightforward) etc., po4a transliterates font escapes into
its own syntax which is a bit more translator-friendly, and
transliterates back at the other end.

A certain amount of syntax is unavoidable here; if it didn't use this
particular kind, you'd just be seeing different (possibly quieter)
errors when translators got their *roff syntax wrong.

This is not all that dissimilar to having translated C format strings
(in which translators have to know to change "%s %d" into "%2$d
%1$s" if they need to change the order round) except that the result is
somewhat more readable.

Colin Watson                                       [cjwatson@debian.org]

Reply to: