bugGNU gettext - Bugs: bug #19086, xgettext doesn't understand...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #19086: xgettext doesn't understand strings with symbols not inside quotes

Submitted by:  Yevgen Muntyan <muntyan>
Submitted on:  Mon 19 Feb 2007 07:33:18 AM UTC  
 
Category: CSeverity: 3 - Normal
Item Group: NoneStatus: Not a Bug
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Thu 30 Aug 2007 09:58:37 AM UTC, comment #3:

> I'd rather say this kind of strings is not supported by xgettext ;)


That's nitpicking about words. Yes, xgettext does not support
the syntax that you happened to choose. But it supports two ways
to do the thing that you indented; that's why I mark this BR
as "works for me".

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Thu 30 Aug 2007 01:12:33 AM UTC, comment #2:

I'd rather say this kind of strings is not supported by xgettext ;)
But I was wrong about garbage passed to printf(), since _() gets whole thing which just doesn't get translated. So it's a very small issue.

Yevgen Muntyan <muntyan>
Wed 29 Aug 2007 10:45:44 PM UTC, comment #1:

This kind of string is supported by xgettext in two different
ways; both are documented in the documentation section
"Preparing Translatable Strings"
http://www.gnu.org/software/gettext/manual/gettext.html#Preparing-Strings

One is to use "%zu" instead of "%" G_GSIZE_FORMAT, relying on
the gnulib modules 'inttypes' and 'printf-posix' for portability
(see http://www.gnu.org/software/gnulib/MODULES.html).

The other is to rewrite the code a bit, as indicated in the above
documentation section.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Mon 19 Feb 2007 07:33:18 AM UTC, original submission:

A code example:

printf (_("foolala %" G_GSIZE_FORMAT "something %s etc"),
some_value, some_string);

(G_GSIZE_FORMAT is "u" or "lu" depending on platform, a substitution for standard "zu").

xgettext extracts only "foolala %" part which means garbage (with trailing % character) is passed to printf.
It would be nice if xgettext either extracted complete argument to _(), or at least warned here.

Yevgen Muntyan <muntyan>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  • -unavailable- added by muntyan (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 26 Nov 2016 11:40:34 PM UTChaibleCategoryNone=>C
    Thu 06 Mar 2008 02:03:39 AM UTChaibleStatusWorks For Me=>Not a Bug
    Sun 30 Sep 2007 11:24:35 PM UTChaibleOpen/ClosedOpen=>Closed
    Wed 29 Aug 2007 10:45:44 PM UTChaibleStatusNone=>Works For Me
      Assigned toNone=>haible

    Back to the top


    Powered by Savane 3.1-cleanup1