Use positional arguments everywhere where we put more than one

string into a translatable sentence to ease the work on more
exotic translations.
This commit is contained in:
Jean-Philippe Fleury 2011-12-02 01:13:54 +01:00 committed by Thomas Keller
parent bfc568967b
commit 7342566c6e
14 changed files with 42 additions and 41 deletions

View File

@ -2,7 +2,8 @@
## Language and Translations ## Language and Translations
- Multiple fixes to English source strings (thanks to JP Fleury!) - Multiple fixes to English source strings (fixes issues 763, 766, and 772,
thanks to JP Fleury!)
# InDefero 1.2 - Sun Nov 6 23:04:00 UTC 2011 # InDefero 1.2 - Sun Nov 6 23:04:00 UTC 2011

View File

@ -235,7 +235,7 @@ class IDF_Commit extends Pluf_Model
</tr> </tr>
<tr class="extra"> <tr class="extra">
<td colspan="2"> <td colspan="2">
<div class="helptext right">'.sprintf(__('Commit %s, by %s'), '<a href="'.$url.'" class="mono">'.$this->scm_id.'</a>', $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Commit %1$s, by %2$s'), '<a href="'.$url.'" class="mono">'.$this->scm_id.'</a>', $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -326,7 +326,7 @@ class IDF_Commit extends Pluf_Model
foreach ($addresses as $address) { foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'), $email = new Pluf_Mail(Pluf::f('from_email'),
$address, $address,
sprintf(__('New Commit %s - %s (%s)'), sprintf(__('New Commit %1$s - %2$s (%3$s)'),
$this->scm_id, $this->summary, $this->scm_id, $this->summary,
$this->get_project()->shortname)); $this->get_project()->shortname));
$email->addTextMessage($text_email); $email->addTextMessage($text_email);

View File

@ -211,7 +211,7 @@ class IDF_Issue extends Pluf_Model
$ic = (in_array($this->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o'; $ic = (in_array($this->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
$out .= sprintf(__('<a href="%1$s" class="%2$s" title="View issue">Issue %3$d</a>, %4$s'), $url, $ic, $this->id, Pluf_esc($this->summary)).'</td>'; $out .= sprintf(__('<a href="%1$s" class="%2$s" title="View issue">Issue %3$d</a>, %4$s'), $url, $ic, $this->id, Pluf_esc($this->summary)).'</td>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Creation of <a href="%s" class="%s">issue %d</a>, by %s'), $url, $ic, $this->id, $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Creation of <a href="%1$s" class="%2$s">issue %3$d</a>, by %4$s'), $url, $ic, $this->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -221,7 +221,7 @@ class IDF_Issue extends Pluf_Model
.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', .Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($request->project->shortname, array($request->project->shortname,
$this->id)); $this->id));
$title = sprintf(__('%s: Issue %d created - %s'), $title = sprintf(__('%1$s: Issue %2$d created - %3$s'),
$request->project->name, $request->project->name,
$this->id, $this->summary); $this->id, $this->summary);
$cts = $this->get_comments_list(array('order' => 'id ASC', $cts = $this->get_comments_list(array('order' => 'id ASC',
@ -287,7 +287,7 @@ class IDF_Issue extends Pluf_Model
foreach ($to_email as $email_lang) { foreach ($to_email as $email_lang) {
Pluf_Translation::loadSetLocale($email_lang[1]); Pluf_Translation::loadSetLocale($email_lang[1]);
$email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0], $email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0],
sprintf(__('Issue %s - %s (%s)'), sprintf(__('Issue %1$s - %2$s (%3$s)'),
$this->id, $this->summary, $prj->shortname)); $this->id, $this->summary, $prj->shortname));
$tmpl = new Pluf_Template('idf/issues/issue-created-email.txt'); $tmpl = new Pluf_Template('idf/issues/issue-created-email.txt');
$email->addTextMessage($tmpl->render($context)); $email->addTextMessage($tmpl->render($context));
@ -333,7 +333,7 @@ class IDF_Issue extends Pluf_Model
} }
Pluf_Translation::loadSetLocale($email_lang[1]); Pluf_Translation::loadSetLocale($email_lang[1]);
$email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0], $email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0],
sprintf(__('Updated Issue %s - %s (%s)'), sprintf(__('Updated Issue %1$s - %2$s (%3$s)'),
$this->id, $this->summary, $prj->shortname)); $this->id, $this->summary, $prj->shortname));
$tmpl = new Pluf_Template('idf/issues/issue-updated-email.txt'); $tmpl = new Pluf_Template('idf/issues/issue-updated-email.txt');
$email->addTextMessage($tmpl->render($context)); $email->addTextMessage($tmpl->render($context));

View File

@ -177,7 +177,7 @@ class IDF_IssueComment extends Pluf_Model
} }
$out .= '</td></tr>'; $out .= '</td></tr>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Comment on <a href="%s" class="%s">issue %d</a>, by %s'), $url, $ic, $issue->id, $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Comment on <a href="%1$s" class="%2$s">issue %3$d</a>, by %4$s'), $url, $ic, $issue->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -188,7 +188,7 @@ class IDF_IssueComment extends Pluf_Model
.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', .Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($request->project->shortname, array($request->project->shortname,
$issue->id)); $issue->id));
$title = sprintf(__('%s: Comment on issue %d - %s'), $title = sprintf(__('%1$s: Comment on issue %2$d - %3$s'),
Pluf_esc($request->project->name), Pluf_esc($request->project->name),
$issue->id, Pluf_esc($issue->summary)); $issue->id, Pluf_esc($issue->summary));
$url .= '#ic'.$this->id; $url .= '#ic'.$this->id;

View File

@ -306,7 +306,7 @@ class IDF_Plugin_SyncMonotone
} }
catch (Exception $e) { catch (Exception $e) {
$this->_diagnoseProblem(sprintf( $this->_diagnoseProblem(sprintf(
__('Could not parse usher configuration in "%s": %s'), __('Could not parse usher configuration in "%1$s": %2$s'),
$usher_config, $e->getMessage() $usher_config, $e->getMessage()
)); ));
} }
@ -522,7 +522,7 @@ class IDF_Plugin_SyncMonotone
} }
catch (Exception $e) { catch (Exception $e) {
$this->_diagnoseProblem(sprintf( $this->_diagnoseProblem(sprintf(
__('Could not parse usher configuration in "%s": %s'), __('Could not parse usher configuration in "%1$s": %2$s'),
$usher_config, $e->getMessage() $usher_config, $e->getMessage()
)); ));
} }
@ -596,7 +596,7 @@ class IDF_Plugin_SyncMonotone
} }
catch (Exception $e) { catch (Exception $e) {
$this->_diagnoseProblem(sprintf( $this->_diagnoseProblem(sprintf(
__('Could not parse read-permissions for project "%s": %s'), __('Could not parse read-permissions for project "%1$s": %2$s'),
$shortname, $e->getMessage() $shortname, $e->getMessage()
)); ));
} }
@ -715,7 +715,7 @@ class IDF_Plugin_SyncMonotone
} }
catch (Exception $e) { catch (Exception $e) {
$this->_diagnoseProblem(sprintf( $this->_diagnoseProblem(sprintf(
__('Could not parse read-permissions for project "%s": %s'), __('Could not parse read-permissions for project "%1$s": %2$s'),
$shortname, $e->getMessage() $shortname, $e->getMessage()
)); ));
} }

View File

@ -138,7 +138,7 @@ class IDF_Review_Comment extends Pluf_Model
$ic = (in_array($review->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o'; $ic = (in_array($review->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
$out .= sprintf(__('<a href="%1$s" class="%2$s" title="View review">Review %3$d</a>, %4$s'), $url, $ic, $review->id, Pluf_esc($review->summary)).'</td>'; $out .= sprintf(__('<a href="%1$s" class="%2$s" title="View review">Review %3$d</a>, %4$s'), $url, $ic, $review->id, Pluf_esc($review->summary)).'</td>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Update of <a href="%s" class="%s">review %d</a>, by %s'), $url, $ic, $review->id, $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Update of <a href="%1$s" class="%2$s">review %3$d</a>, by %4$s'), $url, $ic, $review->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -148,7 +148,7 @@ class IDF_Review_Comment extends Pluf_Model
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($request->project->shortname, array($request->project->shortname,
$review->id)); $review->id));
$title = sprintf(__('%s: Updated review %d - %s'), $title = sprintf(__('%1$s: Updated review %2$d - %3$s'),
Pluf_esc($request->project->name), Pluf_esc($request->project->name),
$review->id, Pluf_esc($review->summary)); $review->id, Pluf_esc($review->summary));
$url .= '#ic'.$this->id; $url .= '#ic'.$this->id;
@ -213,7 +213,7 @@ class IDF_Review_Comment extends Pluf_Model
foreach ($to_email as $email_lang) { foreach ($to_email as $email_lang) {
Pluf_Translation::loadSetLocale($email_lang[1]); Pluf_Translation::loadSetLocale($email_lang[1]);
$email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0], $email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0],
sprintf(__('Updated Code Review %s - %s (%s)'), sprintf(__('Updated Code Review %1$s - %2$s (%3$s)'),
$review->id, $review->summary, $prj->shortname)); $review->id, $review->summary, $prj->shortname));
$email->addTextMessage($tmpl->render($context)); $email->addTextMessage($tmpl->render($context));

View File

@ -150,7 +150,7 @@ class IDF_Review_Patch extends Pluf_Model
$ic = (in_array($review->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o'; $ic = (in_array($review->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
$out .= sprintf(__('<a href="%1$s" class="%2$s" title="View review">Review %3$d</a>, %4$s'), $url, $ic, $review->id, Pluf_esc($review->summary)).'</td>'; $out .= sprintf(__('<a href="%1$s" class="%2$s" title="View review">Review %3$d</a>, %4$s'), $url, $ic, $review->id, Pluf_esc($review->summary)).'</td>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Creation of <a href="%s" class="%s">review %d</a>, by %s'), $url, $ic, $review->id, $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Creation of <a href="%1$s" class="%2$s">review %3$d</a>, by %4$s'), $url, $ic, $review->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -160,7 +160,7 @@ class IDF_Review_Patch extends Pluf_Model
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($request->project->shortname, array($request->project->shortname,
$review->id)); $review->id));
$title = sprintf(__('%s: Creation of Review %d - %s'), $title = sprintf(__('%1$s: Creation of Review %2$d - %3$s'),
Pluf_esc($request->project->name), Pluf_esc($request->project->name),
$review->id, Pluf_esc($review->summary)); $review->id, Pluf_esc($review->summary));
$date = Pluf_Date::gmDateToGmString($this->creation_dtime); $date = Pluf_Date::gmDateToGmString($this->creation_dtime);
@ -201,7 +201,7 @@ class IDF_Review_Patch extends Pluf_Model
foreach ($addresses as $address) { foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'), $email = new Pluf_Mail(Pluf::f('from_email'),
$address, $address,
sprintf(__('New Code Review %s - %s (%s)'), sprintf(__('New Code Review %1$s - %2$s (%3$s)'),
$this->get_review()->id, $this->get_review()->id,
$this->get_review()->summary, $this->get_review()->summary,
$this->get_review()->get_project()->shortname)); $this->get_review()->get_project()->shortname));

View File

@ -201,7 +201,7 @@ class IDF_Upload extends Pluf_Model
$out .= sprintf(__('<a href="%1$s" title="View download">Download %2$d</a>, %3$s'), $url, $this->id, Pluf_esc($this->summary)).'</td>'; $out .= sprintf(__('<a href="%1$s" title="View download">Download %2$d</a>, %3$s'), $url, $this->id, Pluf_esc($this->summary)).'</td>';
$out .= '</tr>'; $out .= '</tr>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Addition of <a href="%s">download %d</a>, by %s'), $url, $this->id, $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Addition of <a href="%1$s">download %2$d</a>, by %3$s'), $url, $this->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -211,7 +211,7 @@ class IDF_Upload extends Pluf_Model
.Pluf_HTTP_URL_urlForView('IDF_Views_Download::view', .Pluf_HTTP_URL_urlForView('IDF_Views_Download::view',
array($request->project->shortname, array($request->project->shortname,
$this->id)); $this->id));
$title = sprintf(__('%s: Download %d added - %s'), $title = sprintf(__('%1$s: Download %2$d added - %3$s'),
$request->project->name, $request->project->name,
$this->id, $this->summary); $this->id, $this->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime); $date = Pluf_Date::gmDateToGmString($this->creation_dtime);
@ -253,7 +253,7 @@ class IDF_Upload extends Pluf_Model
foreach ($addresses as $address) { foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'), $email = new Pluf_Mail(Pluf::f('from_email'),
$address, $address,
sprintf(__('New download - %s (%s)'), sprintf(__('New download - %1$s (%2$s)'),
$this->summary, $this->summary,
$this->get_project()->shortname)); $this->get_project()->shortname));
$email->addTextMessage($text_email); $email->addTextMessage($text_email);

View File

@ -338,19 +338,19 @@ class IDF_Views_Issue
if (count($ctags) == 0) $ctags[] = 0; if (count($ctags) == 0) $ctags[] = 0;
switch ($match[3]) { switch ($match[3]) {
case 'submit': case 'submit':
$titleFormat = __('%s %s Submitted %s Issues'); $titleFormat = __('%1$s %2$s Submitted %3$s Issues');
$f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id)); $f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id));
break; break;
case 'submitclosed': case 'submitclosed':
$titleFormat = __('%s %s Closed Submitted %s Issues'); $titleFormat = __('%1$s %2$s Closed Submitted %3$s Issues');
$f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id)); $f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id));
break; break;
case 'ownerclosed': case 'ownerclosed':
$titleFormat = __('%s %s Closed Working %s Issues'); $titleFormat = __('%1$s %2$s Closed Working %3$s Issues');
$f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id)); $f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id));
break; break;
default: default:
$titleFormat = __('%s %s Working %s Issues'); $titleFormat = __('%1$s %2$s Working %3$s Issues');
$f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id)); $f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id));
break; break;
} }
@ -427,7 +427,7 @@ class IDF_Views_Issue
array($prj->shortname, $issue->id)); array($prj->shortname, $issue->id));
$issue->notify($request->conf); $issue->notify($request->conf);
if ($api) return $issue; if ($api) return $issue;
$request->user->setMessage(sprintf(__('<a href="%s">Issue %d</a> has been created.'), $url, $issue->id)); $request->user->setMessage(sprintf(__('<a href="%1$s">Issue %2$d</a> has been created.'), $url, $issue->id));
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);
} }
} else { } else {
@ -598,7 +598,7 @@ class IDF_Views_Issue
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($prj->shortname, $issue->id)); array($prj->shortname, $issue->id));
$title = Pluf_Template::markSafe(sprintf(__('Issue <a href="%s">%d</a>: %s'), $url, $issue->id, $issue->summary)); $title = Pluf_Template::markSafe(sprintf(__('Issue <a href="%1$s">%2$d</a>: %3$s'), $url, $issue->id, $issue->summary));
$form = false; // The form is available only if logged in. $form = false; // The form is available only if logged in.
$starred = false; $starred = false;
$closed = in_array($issue->status, $prj->getTagIdsByStatus('closed')); $closed = in_array($issue->status, $prj->getTagIdsByStatus('closed'));
@ -622,7 +622,7 @@ class IDF_Views_Issue
$issue->notify($request->conf, false); $issue->notify($request->conf, false);
$comments = $issue->get_comments_list(array('order' => 'id DESC')); $comments = $issue->get_comments_list(array('order' => 'id DESC'));
$url .= '#ic' . $comments[0]->id; $url .= '#ic' . $comments[0]->id;
$request->user->setMessage(sprintf(__('<a href="%s">Issue %d</a> has been updated.'), $url, $issue->id)); $request->user->setMessage(sprintf(__('<a href="%1$s">Issue %2$d</a> has been updated.'), $url, $issue->id));
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);
} }
} else { } else {

View File

@ -91,7 +91,7 @@ class IDF_Views_Review
$review = $form->save(); $review = $form->save();
$urlr = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', $urlr = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($prj->shortname, $review->id)); array($prj->shortname, $review->id));
$request->user->setMessage(sprintf(__('The <a href="%s">code review %d</a> has been created.'), $urlr, $review->id)); $request->user->setMessage(sprintf(__('The <a href="%1$s">code review %2$d</a> has been created.'), $urlr, $review->id));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::index', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::index',
array($prj->shortname)); array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);
@ -137,7 +137,7 @@ class IDF_Views_Review
$prj->inOr404($review); $prj->inOr404($review);
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($prj->shortname, $review->id)); array($prj->shortname, $review->id));
$title = Pluf_Template::markSafe(sprintf(__('Review <a href="%s">%d</a>: %s'), $url, $review->id, $review->summary)); $title = Pluf_Template::markSafe(sprintf(__('Review <a href="%1$s">%2$d</a>: %3$s'), $url, $review->id, $review->summary));
$patches = $review->get_patches_list(); $patches = $review->get_patches_list();
$patch = $patches[0]; $patch = $patches[0];
@ -157,7 +157,7 @@ class IDF_Views_Review
$review = $patch->get_review(); $review = $patch->get_review();
$urlr = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', $urlr = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($prj->shortname, $review->id)); array($prj->shortname, $review->id));
$request->user->setMessage(sprintf(__('Your <a href="%s">code review %d</a> has been published.'), $urlr, $review->id)); $request->user->setMessage(sprintf(__('Your <a href="%1$s">code review %2$d</a> has been published.'), $urlr, $review->id));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::index', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::index',
array($prj->shortname)); array($prj->shortname));
$review_comment->notify($request->conf); $review_comment->notify($request->conf);

View File

@ -302,7 +302,7 @@ class IDF_Views_Source
throw new Exception('could not retrieve commit object for '. $commit); throw new Exception('could not retrieve commit object for '. $commit);
} }
$title = sprintf(__('%s Commit Details'), (string) $request->project); $title = sprintf(__('%s Commit Details'), (string) $request->project);
$page_title = sprintf(__('%s Commit Details - %s'), (string) $request->project, $commit); $page_title = sprintf(__('%1$s Commit Details - %2$s'), (string) $request->project, $commit);
$rcommit = IDF_Commit::getOrAdd($cobject, $request->project); $rcommit = IDF_Commit::getOrAdd($cobject, $request->project);
$diff = new IDF_Diff($cobject->diff, $scm->getDiffPathStripLevel()); $diff = new IDF_Diff($cobject->diff, $scm->getDiffPathStripLevel());
$cobject->diff = null; $cobject->diff = null;

View File

@ -181,7 +181,7 @@ class IDF_Views_Wiki
$page = $form->save(); $page = $form->save();
$urlpage = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view', $urlpage = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
array($prj->shortname, $page->title)); array($prj->shortname, $page->title));
$request->user->setMessage(sprintf(__('The page <a href="%s">%s</a> has been created.'), $urlpage, Pluf_esc($page->title))); $request->user->setMessage(sprintf(__('The page <a href="%1$s">%2$s</a> has been created.'), $urlpage, Pluf_esc($page->title)));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index',
array($prj->shortname)); array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);
@ -319,7 +319,7 @@ class IDF_Views_Wiki
$page = $form->save(); $page = $form->save();
$urlpage = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view', $urlpage = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
array($prj->shortname, $page->title)); array($prj->shortname, $page->title));
$request->user->setMessage(sprintf(__('The page <a href="%s">%s</a> has been updated.'), $urlpage, Pluf_esc($page->title))); $request->user->setMessage(sprintf(__('The page <a href="%1$s">%2$s</a> has been updated.'), $urlpage, Pluf_esc($page->title)));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index', $url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index',
array($prj->shortname)); array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);

View File

@ -195,7 +195,7 @@ class IDF_WikiPage extends Pluf_Model
$user = $stag->start($this->get_submitter(), $request, '', false); $user = $stag->start($this->get_submitter(), $request, '', false);
$out .= sprintf(__('<a href="%1$s" title="View page">%2$s</a>, %3$s'), $url, Pluf_esc($this->title), Pluf_esc($this->summary)).'</td>'; $out .= sprintf(__('<a href="%1$s" title="View page">%2$s</a>, %3$s'), $url, Pluf_esc($this->title), Pluf_esc($this->summary)).'</td>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Creation of <a href="%s">page %s</a>, by %s'), $url, Pluf_esc($this->title), $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Creation of <a href="%1$s">page %2$s</a>, by %3$s'), $url, Pluf_esc($this->title), $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -205,7 +205,7 @@ class IDF_WikiPage extends Pluf_Model
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view', .Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
array($request->project->shortname, array($request->project->shortname,
$this->title)); $this->title));
$title = sprintf(__('%s: Documentation page %s added - %s'), $title = sprintf(__('%1$s: Documentation page %2$s added - %3$s'),
$request->project->name, $request->project->name,
$this->title, $this->summary); $this->title, $this->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime); $date = Pluf_Date::gmDateToGmString($this->creation_dtime);

View File

@ -186,7 +186,7 @@ class IDF_WikiRevision extends Pluf_Model
} }
$out .= '</td></tr>'; $out .= '</td></tr>';
$out .= "\n".'<tr class="extra"><td colspan="2"> $out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Change of <a href="%s">%s</a>, by %s'), $url, Pluf_esc($page->title), $user).'</div></td></tr>'; <div class="helptext right">'.sprintf(__('Change of <a href="%1$s">%2$s</a>, by %3$s'), $url, Pluf_esc($page->title), $user).'</div></td></tr>';
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
@ -205,7 +205,7 @@ class IDF_WikiRevision extends Pluf_Model
array($request->project->shortname, array($request->project->shortname,
$page->title)); $page->title));
} }
$title = sprintf(__('%s: Documentation page %s updated - %s'), $title = sprintf(__('%1$s: Documentation page %2$s updated - %3$s'),
$request->project->name, $request->project->name,
$page->title, $page->summary); $page->title, $page->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime); $date = Pluf_Date::gmDateToGmString($this->creation_dtime);
@ -259,13 +259,13 @@ class IDF_WikiRevision extends Pluf_Model
); );
if ($create) { if ($create) {
$template = 'idf/wiki/wiki-created-email.txt'; $template = 'idf/wiki/wiki-created-email.txt';
$title = sprintf(__('New Documentation Page %s - %s (%s)'), $title = sprintf(__('New Documentation Page %1$s - %2$s (%3$s)'),
$this->get_wikipage()->title, $this->get_wikipage()->title,
$this->get_wikipage()->summary, $this->get_wikipage()->summary,
$this->get_wikipage()->get_project()->shortname); $this->get_wikipage()->get_project()->shortname);
} else { } else {
$template = 'idf/wiki/wiki-updated-email.txt'; $template = 'idf/wiki/wiki-updated-email.txt';
$title = sprintf(__('Documentation Page Changed %s - %s (%s)'), $title = sprintf(__('Documentation Page Changed %1$s - %2$s (%3$s)'),
$this->get_wikipage()->title, $this->get_wikipage()->title,
$this->get_wikipage()->summary, $this->get_wikipage()->summary,
$this->get_wikipage()->get_project()->shortname); $this->get_wikipage()->get_project()->shortname);