<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Francesco Lodolo skrev:
<blockquote
cite="mid:92dfaa8c0703281113r23ed6aafsbdf3cb33597eab93@mail.gmail.com"
type="cite">
<div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">php-format
does mean that you should use the php sprintf format, but<br>
perhaps a better explanation would be:
</blockquote>
</div>
<br>
Ok, but if we have a string like "My father's name is %s" ?<br>
<br>
The string should be saved in .po file as "My father's name is %s" or
"My father\'s name is %s"
<br>
<br>
Some links:<br>
<a moz-do-not-send="true"
href="http://ursine.ca/cgi-bin/info2www?%28gettext%29php-format">http://ursine.ca/cgi-bin/info2www?(gettext)php-format</a><br>
<a moz-do-not-send="true"
href="http://www.php.net/manual/en/function.sprintf.php">http://www.php.net/manual/en/function.sprintf.php
</a><br>
<br>
Example code from the second link:<br>
<blockquote
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"
class="gmail_quote">
<div class="example-contents">
<div class="phpcode"><code><span class="html"><span class="default"><?php<br>
$format </span><span class="keyword">= </span><span class="string">'The
%2$s contains %1$d monkeys.<br>
That\'s a nice %2$s full of %1$d monkeys.'</span><span
class="keyword">;<br>
</span><span class="default">printf</span><span class="keyword">(</span><span
class="default">$format</span><span class="keyword">, </span><span
class="default">$num</span><span class="keyword">, </span><span
class="default">
$location</span><span class="keyword">);<br>
</span><span class="default">?></span>
</span></code></div>
</div>
</blockquote>
<br>
I think that a solution is easy:<br>
<ul>
<li>if someone is using poEdit: find a string with ' inside and the
php-format flag, look at the .po file with an external editor and look
how the ' is saved
</li>
<li>create an example in php and test if the string without \'
creates problems.</li>
</ul>
Francesco.<br>
<pre wrap="">
</pre>
</blockquote>
In your example from php.net, ' should be escaped because it is the
character that surrounds the text. In the po file " is used instead of
'. Thus ' should not be escaped, but " should. In PHP, the escape
character is \. In the po file, i don't know what escape character to
use. If you use a fancy po file editor instead of a text editor, the
editor would probably take care of this.<br>
I understand Wil's message as: The only thing "php-format" does is
telling you what <code><span class="html"><span class="string">%1$d
and </span></span></code><code><span class="html"><span class="string">%2$s
means.<br>
</span></span></code>
</body>
</html>