bugGNU gettext - Bugs: bug #30558, xgettext chokes on string literals...

 
 

bug #30558: xgettext chokes on string literals not being extracted

Submitted by:  None
Submitted on:  Tue 27 Jul 2010 01:58:27 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: Miguel Ángel Arruga Vivas <m1gu3l>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 26 Mar 2014 09:53:40 AM UTC, comment #2:

Works for me as well, closing.

Daiki Ueno <ueno>
Project Administrator
Tue 29 Jan 2013 03:08:28 PM UTC, comment #1:

It is already fixed at some release since 2010.

<code>
$ xgettext --add-comments isjpeg.py -o -
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-29 16:06+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: isjpeg.py:9
#, python-format
msgid "%s looks like a JPEG file"
msgstr ""

#: isjpeg.py:11
#, python-format
msgid "%s does not look like a JPEG file"
msgstr ""

#: isjpeg.py:16
#, python-format
msgid "Usage: %s <filename>"
msgstr ""
</code>

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Tue 27 Jul 2010 01:58:27 AM UTC, original submission:

Attached is a simple example where xgettext chokes on a string literal ('\xff\xd8' representing a binary JPEG header) which is not supposed to be processed at all as it is not passed to a translation function and the --extract-all option was not specified.

$ xgettext isjpeg.py
xgettext: Non-ASCII string at isjpeg.py:5.
Please specify the source encoding through --from-code.

xgettext should ignore string literals which are not being extracted. This is particularly a problem in languages such as Python (< 3.0) where there is no clear distinction between binary strings and text strings.

(BTW the error message above is doubly wrong because the --from-code option is not available for Python).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21079:  isjpeg.py added by None (513B - text/plain - corrected example python source file)
file #21078:  isjpeg.py added by None (513B - text/plain - example python source file)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ueno (Posted a comment)
  • -unavailable- added by m1gu3l (Posted a comment)
  •  

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 26 Mar 2014 09:53:40 AM UTCuenoStatusNeed Info=>Works For Me
      Open/ClosedOpen=>Closed
    Fri 01 Mar 2013 09:42:38 PM UTCm1gu3lStatusNone=>Need Info
      Assigned toNone=>m1gu3l
    Tue 27 Jul 2010 02:01:01 AM UTCNoneAttached File-=>Added isjpeg.py, #21079
    Tue 27 Jul 2010 01:58:27 AM UTCNoneAttached File-=>Added isjpeg.py, #21078

    Back to the top


    Powered by Savane 3.1-cleanup