Browse Source

Merge pull request #4943 from okinaka/3.0-fix-i18n-placeholder

Fix i18n placeholder for view tamplates.
José Lorenzo Rodríguez 11 years ago
parent
commit
3415812b2f

+ 1 - 1
src/Template/Bake/default/views/form.ctp

@@ -23,7 +23,7 @@ $fields = collection($fields)
 	<h3><?= "<?= __('Actions') ?>" ?></h3>
 	<ul class="side-nav">
 <?php if (strpos($action, 'add') === false): ?>
-		<li><?= "<?= \$this->Form->postLink(__('Delete'), ['action' => 'delete', \${$singularVar}->{$primaryKey[0]}], ['confirm' => __('Are you sure you want to delete # %s?', \${$singularVar}->{$primaryKey[0]})]) ?>" ?></li>
+		<li><?= "<?= \$this->Form->postLink(__('Delete'), ['action' => 'delete', \${$singularVar}->{$primaryKey[0]}], ['confirm' => __('Are you sure you want to delete # {0}?', \${$singularVar}->{$primaryKey[0]})]) ?>" ?></li>
 <?php endif; ?>
 		<li><?= "<?= \$this->Html->link(__('List " . $pluralHumanName . "'), ['action' => 'index']) ?>" ?></li>
 <?php

+ 2 - 2
src/Template/Bake/default/views/view.ctp

@@ -57,7 +57,7 @@ $groupedFields += ['number' => [], 'string' => [], 'boolean' => [], 'date' => []
 	$pk = "\${$singularVar}->{$primaryKey[0]}";
 
 	echo "\t\t<li><?= \$this->Html->link(__('Edit " . $singularHumanName . "'), ['action' => 'edit', {$pk}]) ?> </li>\n";
-	echo "\t\t<li><?= \$this->Form->postLink(__('Delete " . $singularHumanName . "'), ['action' => 'delete', {$pk}], ['confirm' => __('Are you sure you want to delete # %s?', {$pk})]) ?> </li>\n";
+	echo "\t\t<li><?= \$this->Form->postLink(__('Delete " . $singularHumanName . "'), ['action' => 'delete', {$pk}], ['confirm' => __('Are you sure you want to delete # {0}?', {$pk})]) ?> </li>\n";
 	echo "\t\t<li><?= \$this->Html->link(__('List " . $pluralHumanName . "'), ['action' => 'index']) ?> </li>\n";
 	echo "\t\t<li><?= \$this->Html->link(__('New " . $singularHumanName . "'), ['action' => 'add']) ?> </li>\n";
 
@@ -160,7 +160,7 @@ echo "\t\t<?php foreach (\${$singularVar}->{$details['property']} as \${$otherSi
 			echo "\t\t\t<td class=\"actions\">\n";
 			echo "\t\t\t\t<?= \$this->Html->link(__('View'), ['controller' => '{$details['controller']}', 'action' => 'view', {$otherPk}]) ?>\n";
 			echo "\t\t\t\t<?= \$this->Html->link(__('Edit'), ['controller' => '{$details['controller']}', 'action' => 'edit', {$otherPk}]) ?>\n";
-			echo "\t\t\t\t<?= \$this->Form->postLink(__('Delete'), ['controller' => '{$details['controller']}', 'action' => 'delete', {$otherPk}], ['confirm' => __('Are you sure you want to delete # %s?', {$otherPk})]) ?>\n";
+			echo "\t\t\t\t<?= \$this->Form->postLink(__('Delete'), ['controller' => '{$details['controller']}', 'action' => 'delete', {$otherPk}], ['confirm' => __('Are you sure you want to delete # {0}?', {$otherPk})]) ?>\n";
 			echo "\t\t\t</td>\n";
 		echo "\t\t</tr>\n";