bugGNU gettext - Bugs: bug #36084, xgettext:no-c-format comment only...

 
 

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

bug #36084: xgettext:no-c-format comment only applies to first of several strings on one line

Submitter:  Christian Ohm <cybersphinx>
Submitted:  Wed 04 Apr 2012 11:48:33 AM UTC
   
 
Category:  C Severity:  3 - Normal
Item Group:  None Status:  Not a Bug
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Wed 15 Mar 2023 11:18:31 PM UTC, comment #3: 

It's preferrable if a single xgettext:no-c-format comment (and likewise, TRANSLATORS: comments) applies only to one string. If it were to apply to all strings in the next line, this would
- increase pressure on the programmer to put several strings into the same line,
- cause a change when, during a refactoring, a line break is inserted between different strings.

So, I'm not changing the code, but merely clarifying the documentation.
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=6fabdc10e3fe51d660517c42da6217d63071f32b

Bruno Haible <haible>
Group administrator
Wed 15 Mar 2023 11:13:43 PM UTC, comment #2: 

I can reproduce the issue through test-comment.c:

int
main (int argc, char **argv)
{
  char ** text;
  /* xgettext:no-c-format */
  text = {_("Production Improved"),_("Factory module enables medium and large bodies"),_("Factory output speed +100% per module"),_("Use a truck to add 50% per module")};
  return 0;
}


xgettext -o - -k_ test-comment.c

Bruno Haible <haible>
Group administrator
Tue 29 Jan 2013 04:22:23 PM UTC, comment #1: 

I have a question, is there a typho in ("Production Improved") and ("Factory module enables medium and large bodies")? Or you also could? If they are not, I am not able to reproduce it with a C language file. If they are, the comment only applies to the first string for translation found.


$ cat test_comment.c

int
main (int argc, char **argv)
{
  char ** text;
  /* xgettext:no-c-format */
  text = {("Production Improved"),("Factory module enables medium and large bodies"),_("Factory output speed +100% per module"),_("Use a truck to add modules to a factory")};
  return 0;
}
$ xgettext -k_ -o - test_comment.c
# 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 17:21+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"

#: test_comment.c:7
#, no-c-format
msgid "Factory output speed +100% per module"
msgstr ""

#: test_comment.c:7
msgid "Use a truck to add modules to a factory"
msgstr ""
+verbatim+

Miguel Ángel Arruga Vivas <m1gu3l>
Group Member
Wed 04 Apr 2012 11:48:33 AM UTC, original submission:  

Example:

; xgettext:no-c-format
text = ("Production Improved"),("Factory module enables medium and large bodies"),_("Factory output speed +100% per module"),_("Use a truck to add modules to a factory"),

In the resulting .po file, only "Production Improved" gets the no-c-format marker, the following ones don't (and the third actually needs it).

Christian Ohm <cybersphinx>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by m1gu3l (Posted a comment)
  • -email is unavailable- added by cybersphinx (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-15 haible StatusNeed Info Not a Bug
        Assigned toNone haible
        Open/ClosedOpen Closed
    2018-11-12 m1gu3l Assigned tom1gu3l None
    2016-11-27 haible CategoryNone C
    2013-03-01 m1gu3l StatusNone Need Info
        Assigned toNone m1gu3l

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code