Re: [Translation-i18n] Variable order in python-format strings



Clytie Siddall wrote:
> I'm a bit stuck on this string in deskbar-applet:
> ____
> po:37
> auto:	â	translators: First %s is the search engine name, second %s
> is the search term
> reference:	â	../deskbar/handlers_browsers.py:67
> flag:	â	python-format
> Original:	â0	Search %s for %s
> ViÃÌt:		TÃm kiám %$2s trong %$1s
> _____
>
> I really need to change the order of the two variables used, but
> msgfmt isn't happy with using the same method as with C strings. Is
> there another method for python strings?

The python-format is documented in the GNU gettext doc as follows:

  Python format strings are described in Python Library reference /
  2. Built-in Types, Exceptions and Functions / 2.2. Built-in Types /
  2.2.6. Sequence Types / 2.2.6.2. String Formatting Operations.
  `http://www.python.org/doc/2.2.1/lib/typesseq-strings.html'.

Now when you look at this URL, you will find no traces of the
reordering with $ as in C. This means, this syntax is not supported
in Python. But what is supported is named arguments:

   Search %(engine)s for %(term)s
   TÃm kiám %(term)s trong %(engine)s

But you will have first to report a bug to the developers, asking them
to use the string "Search %(engine)s for %(term)s". (See the
Report-Msgid-Bugs-To address.)

Bruno



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