bugGNU gettext - Bugs: bug #30536, gettext cannot handle C concat...

 
 

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

bug #30536: gettext cannot handle C concat const strings

Submitted by:  Tao Wang <dancefire>
Submitted on:  Sat 24 Jul 2010 03:42:36 AM UTC  
 
Category: CSeverity: 3 - Normal
Item Group: NoneStatus: Not a Bug
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Tue 27 Jul 2010 08:44:18 AM UTC, comment #1:

This is explained in the documentation, at
http://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html

It works if you use the standard macros from ISO C99 <inttypes.h>.
In that case, use PRId64 instead of G_GINT64_FORMAT.
Note that PRId64 is not correctly defined on some platforms;
you need gnulib's 'inttypes' module if you want a correct
<inttypes.h> on all platforms.

Another workaround, if you want to use G_GINT64_FORMAT,
is to separate platform-dependent and internationalized code,
like this:

char buf1[100];
sprintf (buf1, "%" G_GINT64_FORMAT, ...);
printf (_("Fatal mail parser error near position %s in folder %s"),
buf1, ...);

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sat 24 Jul 2010 03:42:36 AM UTC, original submission:

If the source code have following kind of string to translate:

_("Fatal mail parser error near position %" G_GINT64_FORMAT " in folder
%s")

which G_GINT64_FORMAT is a define, such as:

#define G_GINT64_FORMAT "lli"

In such case, gettext is fail to extract the string

"Fatal mail parser error near position %lli in folder %s",

instead, it truncate the string to invalid string:

"Fatal mail parser error near position %"

It's also impossible for translator to translate it.

The bug is first reported at : https://bugzilla.gnome.org/show_bug.cgi?id=625083
And redirect it here as it's an bug of gettext.

Tao Wang <dancefire>

 

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 dancefire (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Nov 2016 12:36:14 AM UTChaibleCategoryNone=>C
      Assigned toNone=>haible
    Tue 27 Jul 2010 08:44:18 AM UTChaibleStatusNone=>Not a Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1