Indefero

Issue 772: A lot of gettext messages don't use numbered placeholders

Reported by Jean-Philippe Fleury, Dec 1, 2011

I attach a patch that makes sure all gettext messages with more than 
one dynamic content use numbered placeholders.

Say the following string:

sprintf(__('My name is %s %s.'), $firstName, $lastName)

It assumes that all languages will use the same order (first name, 
last name), but we can't make this assumption. We don't know how it 
will be translated. The problem can be solved as follows:

sprintf(__('My name is %1$s %2$s.'), $firstName, $lastName)

Comment 1 by Thomas Keller, Dec 2, 2011

Applied in revision 7342566.

Keep up the good work! I think I have to review some of my new 
strings as well...
Status: Fixed

Comment 2 by Thomas Keller, Dec 2, 2011

Labels: Milestone:Release1.2.1

Created: 1 year 6 months ago by Jean-Philippe Fleury

Updated: 1 year 6 months ago

Status: Fixed

Followed by: 2 persons

Labels:
Type:Defect
Priority:Medium
Milestone:Release1.2.1