Merge branch '2.4'

* 2.4:
  $default can be string
  Fix wording for Process class documentation
  Option can be bool too (eg. --force)
  [Form] Update DateTime objects only if the actual value has changed
  Revert "bug #10091 [Translation] Update PluralizationRules.php (guilhermeblanco)"
  [HttpFoundation] fixed typo
  Added delta for Request comparison
  add zh_TW validator translations
  Added Bulgarian translation for security component
This commit is contained in:
Fabien Potencier 2014-02-03 18:15:42 +01:00
commit 4c9e30714d
10 changed files with 388 additions and 33 deletions

View File

@ -31,7 +31,7 @@ class DialogHelper extends InputAwareHelper
* @param OutputInterface $output An Output instance
* @param string|array $question The question to ask
* @param array $choices List of choices to pick from
* @param Boolean $default The default answer if the user enters nothing
* @param Boolean|string $default The default answer if the user enters nothing
* @param Boolean|integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param string $errorMessage Message which will be shown if invalid value from choice list would be picked
* @param Boolean $multiselect Select more than one value separated by comma

View File

@ -186,8 +186,8 @@ abstract class Input implements InputInterface
/**
* Sets an option value by name.
*
* @param string $name The option name
* @param string $value The option value
* @param string $name The option name
* @param string|boolean $value The option value
*
* @throws \InvalidArgumentException When option given doesn't exist
*/

View File

@ -120,8 +120,8 @@ interface InputInterface
/**
* Sets an option value by name.
*
* @param string $name The option name
* @param string $value The option value
* @param string $name The option name
* @param string|boolean $value The option value
*
* @throws \InvalidArgumentException When option given doesn't exist
*/

View File

@ -81,6 +81,13 @@ class PropertyPathMapper implements DataMapperInterface
// Write-back is disabled if the form is not synchronized (transformation failed),
// if the form was not submitted and if the form is disabled (modification not allowed)
if (null !== $propertyPath && $config->getMapped() && $form->isSubmitted() && $form->isSynchronized() && !$form->isDisabled()) {
// If the field is of type DateTime and the data is the same skip the update to
// keep the original object hash
if ($form->getData() instanceof \DateTime && $form->getData() == $this->propertyAccessor->getValue($data, $propertyPath)) {
continue;
}
// If the data is identical to the value in $data, we are
// dealing with a reference
if (!is_object($data) || !$config->getByReference() || $form->getData() !== $this->propertyAccessor->getValue($data, $propertyPath)) {

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\HttpFoundation;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* FileBag is a container for HTTP headers.
* FileBag is a container for uploaded files.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>

View File

@ -44,14 +44,7 @@ class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
$subRequest->headers->set('x-forwarded-for', array('127.0.0.1'));
$subRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1');
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$kernel
->expects($this->any())
->method('handle')
->with($subRequest)
;
$strategy = new InlineFragmentRenderer($kernel);
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest($subRequest));
$strategy->render(new ControllerReference('main_controller', array('object' => $object), array()), Request::create('/'));
}
@ -80,15 +73,7 @@ class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, '');
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$kernel
->expects($this->any())
->method('handle')
->with(Request::create('/'))
;
$strategy = new InlineFragmentRenderer($kernel);
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest(Request::create('/')));
$strategy->render('/', Request::create('/'));
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, $trustedHeaderName);
@ -139,6 +124,22 @@ class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
return $kernel;
}
/**
* Creates a Kernel expecting a request equals to $request
* Allows delta in comparison in case REQUEST_TIME changed by 1 second
*/
private function getKernelExpectingRequest(Request $request)
{
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$kernel
->expects($this->any())
->method('handle')
->with($this->equalTo($request, 1))
;
return $kernel;
}
public function testExceptionInSubRequestsDoesNotMangleOutputBuffers()
{
$resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
@ -180,14 +181,7 @@ class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
$expectedSubRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1');
}
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$kernel
->expects($this->any())
->method('handle')
->with($expectedSubRequest)
;
$strategy = new InlineFragmentRenderer($kernel);
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest($expectedSubRequest));
$request = Request::create('/');
$request->headers->set('Surrogate-Capability', 'abc="ESI/1.0"');

View File

@ -18,7 +18,7 @@ use Symfony\Component\Process\Exception\ProcessTimedOutException;
use Symfony\Component\Process\Exception\RuntimeException;
/**
* Process is a thin wrapper around proc_* functions to ease
* Process is a thin wrapper around proc_* functions to easily
* start independent PHP processes.
*
* @author Fabien Potencier <fabien@symfony.com>

View File

@ -0,0 +1,71 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>An authentication exception occurred.</source>
<target>Грешка при автентикация.</target>
</trans-unit>
<trans-unit id="2">
<source>Authentication credentials could not be found.</source>
<target>Удостоверението за автентикация не е открито.</target>
</trans-unit>
<trans-unit id="3">
<source>Authentication request could not be processed due to a system problem.</source>
<target>Заявката за автентикация не може да бъде обработената поради системна грешка.</target>
</trans-unit>
<trans-unit id="4">
<source>Invalid credentials.</source>
<target>Невалидно удостоверение за автентикация.</target>
</trans-unit>
<trans-unit id="5">
<source>Cookie has already been used by someone else.</source>
<target>Това cookie вече се ползва от някой друг.</target>
</trans-unit>
<trans-unit id="6">
<source>Not privileged to request the resource.</source>
<target>Нямате права за достъп до този ресурс.</target>
</trans-unit>
<trans-unit id="7">
<source>Invalid CSRF token.</source>
<target>Невалиден CSRF токен.</target>
</trans-unit>
<trans-unit id="8">
<source>Digest nonce has expired.</source>
<target>Digest nonce е изтекъл.</target>
</trans-unit>
<trans-unit id="9">
<source>No authentication provider found to support the authentication token.</source>
<target>Не е открит провайдър, който да поддържа този токен за автентикация.</target>
</trans-unit>
<trans-unit id="10">
<source>No session available, it either timed out or cookies are not enabled.</source>
<target>Сесията не е достъпна, или времето за достъп е изтекло, или кукитата не са разрешени.</target>
</trans-unit>
<trans-unit id="11">
<source>No token could be found.</source>
<target>Токена не е открит.</target>
</trans-unit>
<trans-unit id="12">
<source>Username could not be found.</source>
<target>Потребителското име не е открито.</target>
</trans-unit>
<trans-unit id="13">
<source>Account has expired.</source>
<target>Акаунта е изтекъл.</target>
</trans-unit>
<trans-unit id="14">
<source>Credentials have expired.</source>
<target>Удостоверението за автентикация е изтекло.</target>
</trans-unit>
<trans-unit id="15">
<source>Account is disabled.</source>
<target>Акаунта е деактивиран.</target>
</trans-unit>
<trans-unit id="16">
<source>Account is locked.</source>
<target>Акаунта е заключен.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -114,7 +114,6 @@ class PluralizationRules
case 'pap':
case 'ps':
case 'pt':
case 'xbr':
case 'so':
case 'sq':
case 'sv':
@ -135,6 +134,7 @@ class PluralizationRules
case 'ln':
case 'mg':
case 'nso':
case 'xbr':
case 'ti':
case 'wa':
return (($number == 0) || ($number == 1)) ? 0 : 1;

View File

@ -0,0 +1,283 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>This value should be false.</source>
<target>該變數的值應為 false 。</target>
</trans-unit>
<trans-unit id="2">
<source>This value should be true.</source>
<target>該變數的值應為 true 。</target>
</trans-unit>
<trans-unit id="3">
<source>This value should be of type {{ type }}.</source>
<target>該變數的類型應為 {{ type }} 。</target>
</trans-unit>
<trans-unit id="4">
<source>This value should be blank.</source>
<target>該變數應為空。</target>
</trans-unit>
<trans-unit id="5">
<source>The value you selected is not a valid choice.</source>
<target>選定變數的值不是有效的選項。</target>
</trans-unit>
<trans-unit id="6">
<source>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</source>
<target>您至少要選擇 {{ limit }} 個選項。</target>
</trans-unit>
<trans-unit id="7">
<source>You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.</source>
<target>您最多能選擇 {{ limit }} 個選項。</target>
</trans-unit>
<trans-unit id="8">
<source>One or more of the given values is invalid.</source>
<target>一個或者多個給定的值無效。</target>
</trans-unit>
<trans-unit id="9">
<source>The fields {{ fields }} were not expected.</source>
<target>非預期的欄位 {{ fields }} 。</target>
</trans-unit>
<trans-unit id="10">
<source>The fields {{ fields }} are missing.</source>
<target>缺少的欄位 {{ fields }} 。</target>
</trans-unit>
<trans-unit id="11">
<source>This value is not a valid date.</source>
<target>該值不是一個有效的日期date。</target>
</trans-unit>
<trans-unit id="12">
<source>This value is not a valid datetime.</source>
<target>該值不是一個有效的日期時間datetime。</target>
</trans-unit>
<trans-unit id="13">
<source>This value is not a valid email address.</source>
<target>該值不是一個有效的郵件地址。</target>
</trans-unit>
<trans-unit id="14">
<source>The file could not be found.</source>
<target>找不到檔案。</target>
</trans-unit>
<trans-unit id="15">
<source>The file is not readable.</source>
<target>無法讀取檔案。</target>
</trans-unit>
<trans-unit id="16">
<source>The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.</source>
<target>檔案太大 ({{ size }} {{ suffix }})。檔案大小不可以超過 {{ limit }} {{ suffix }} 。</target>
</trans-unit>
<trans-unit id="17">
<source>The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.</source>
<target>無效的檔案類型 ({{ type }}) 。允許的檔案類型有 {{ types }} 。</target>
</trans-unit>
<trans-unit id="18">
<source>This value should be {{ limit }} or less.</source>
<target>這個變數的值應該小於或等於 {{ limit }}。</target>
</trans-unit>
<trans-unit id="19">
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
<target>字串太長,長度不可超過 {{ limit }} 個字元。</target>
</trans-unit>
<trans-unit id="20">
<source>This value should be {{ limit }} or more.</source>
<target>該變數的值應該大於或等於 {{ limit }}。</target>
</trans-unit>
<trans-unit id="21">
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
<target>字串太短,長度不可少於 {{ limit }} 個字元。</target>
</trans-unit>
<trans-unit id="22">
<source>This value should not be blank.</source>
<target>該變數不應為空白。</target>
</trans-unit>
<trans-unit id="23">
<source>This value should not be null.</source>
<target>該值不應為 null 。</target>
</trans-unit>
<trans-unit id="24">
<source>This value should be null.</source>
<target>該值應為 null 。</target>
</trans-unit>
<trans-unit id="25">
<source>This value is not valid.</source>
<target>無效的數值 。</target>
</trans-unit>
<trans-unit id="26">
<source>This value is not a valid time.</source>
<target>該值不是一個有效的時間。</target>
</trans-unit>
<trans-unit id="27">
<source>This value is not a valid URL.</source>
<target>該值不是一個有效的 URL 。</target>
</trans-unit>
<trans-unit id="31">
<source>The two values should be equal.</source>
<target>這兩個變數的值應該相等。</target>
</trans-unit>
<trans-unit id="32">
<source>The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.</source>
<target>檔案太大,檔案大小不可以超過 {{ limit }} {{ suffix }}。 </target>
</trans-unit>
<trans-unit id="33">
<source>The file is too large.</source>
<target>檔案太大。</target>
</trans-unit>
<trans-unit id="34">
<source>The file could not be uploaded.</source>
<target>無法上傳此檔案。</target>
</trans-unit>
<trans-unit id="35">
<source>This value should be a valid number.</source>
<target>該值應該為有效的數字。</target>
</trans-unit>
<trans-unit id="36">
<source>This value is not a valid country.</source>
<target>該值不是有效的國家名。</target>
</trans-unit>
<trans-unit id="37">
<source>This file is not a valid image.</source>
<target>該檔案不是有效的圖片。</target>
</trans-unit>
<trans-unit id="38">
<source>This is not a valid IP address.</source>
<target>該值不是有效的IP地址。</target>
</trans-unit>
<trans-unit id="39">
<source>This value is not a valid language.</source>
<target>該值不是有效的語言名。</target>
</trans-unit>
<trans-unit id="40">
<source>This value is not a valid locale.</source>
<target>該值不是有效的區域值locale。</target>
</trans-unit>
<trans-unit id="41">
<source>This value is already used.</source>
<target>該值已經被使用。</target>
</trans-unit>
<trans-unit id="42">
<source>The size of the image could not be detected.</source>
<target>不能解析圖片大小。</target>
</trans-unit>
<trans-unit id="43">
<source>The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.</source>
<target>圖片太寬 ({{ width }}px),最大寬度為 {{ max_width }}px 。</target>
</trans-unit>
<trans-unit id="44">
<source>The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.</source>
<target>圖片寬度不夠 ({{ width }}px),最小寬度為 {{ min_width }}px 。</target>
</trans-unit>
<trans-unit id="45">
<source>The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.</source>
<target>圖片太高 ({{ height }}px),最大高度為 {{ max_height }}px 。</target>
</trans-unit>
<trans-unit id="46">
<source>The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.</source>
<target>圖片高度不夠 ({{ height }}px),最小高度為 {{ min_height }}px 。</target>
</trans-unit>
<trans-unit id="47">
<source>This value should be the user current password.</source>
<target>該變數的值應為用戶目前的密碼。</target>
</trans-unit>
<trans-unit id="48">
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
<target>該變數應為 {{ limit }} 個字元。</target>
</trans-unit>
<trans-unit id="49">
<source>The file was only partially uploaded.</source>
<target>該檔案的上傳不完整。</target>
</trans-unit>
<trans-unit id="50">
<source>No file was uploaded.</source>
<target>沒有上傳任何檔案。</target>
</trans-unit>
<trans-unit id="51">
<source>No temporary folder was configured in php.ini.</source>
<target>php.ini 裡沒有配置臨時目錄。</target>
</trans-unit>
<trans-unit id="52">
<source>Cannot write temporary file to disk.</source>
<target>暫存檔寫入磁碟失敗。</target>
</trans-unit>
<trans-unit id="53">
<source>A PHP extension caused the upload to fail.</source>
<target>某個 PHP 擴展造成上傳失敗。</target>
</trans-unit>
<trans-unit id="54">
<source>This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.</source>
<target>該集合最少應包含 {{ limit }} 個元素。</target>
</trans-unit>
<trans-unit id="55">
<source>This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.</source>
<target>該集合最多包含 {{ limit }} 個元素。</target>
</trans-unit>
<trans-unit id="56">
<source>This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.</source>
<target>該集合應包含 {{ limit }} 個元素 element 。</target>
</trans-unit>
<trans-unit id="57">
<source>Invalid card number.</source>
<target>無效的信用卡號。</target>
</trans-unit>
<trans-unit id="58">
<source>Unsupported card type or invalid card number.</source>
<target>不支援的信用卡類型或無效的信用卡號。</target>
</trans-unit>
<trans-unit id="59">
<source>This is not a valid International Bank Account Number (IBAN).</source>
<target>該值不是有效的國際銀行帳號IBAN。</target>
</trans-unit>
<trans-unit id="60">
<source>This value is not a valid ISBN-10.</source>
<target>該值不是有效的10位國際標準書號ISBN-10。</target>
</trans-unit>
<trans-unit id="61">
<source>This value is not a valid ISBN-13.</source>
<target>該值不是有效的13位國際標準書號ISBN-13。</target>
</trans-unit>
<trans-unit id="62">
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
<target>該值不是有效的國際標準書號ISBN-10 或 ISBN-13。</target>
</trans-unit>
<trans-unit id="63">
<source>This value is not a valid ISSN.</source>
<target>該值不是有效的國際標準期刊號ISSN。</target>
</trans-unit>
<trans-unit id="64">
<source>This value is not a valid currency.</source>
<target>該值不是有效的貨幣名currency。</target>
</trans-unit>
<trans-unit id="65">
<source>This value should be equal to {{ compared_value }}.</source>
<target>該值應等於 {{ compared_value }} 。</target>
</trans-unit>
<trans-unit id="66">
<source>This value should be greater than {{ compared_value }}.</source>
<target>該值應大於 {{ compared_value }} 。</target>
</trans-unit>
<trans-unit id="67">
<source>This value should be greater than or equal to {{ compared_value }}.</source>
<target>該值應大於或等於 {{ compared_value }} 。</target>
</trans-unit>
<trans-unit id="68">
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>該值應與 {{ compared_value_type }} {{ compared_value }} 相同。</target>
</trans-unit>
<trans-unit id="69">
<source>This value should be less than {{ compared_value }}.</source>
<target>該值應小於 {{ compared_value }} 。</target>
</trans-unit>
<trans-unit id="70">
<source>This value should be less than or equal to {{ compared_value }}.</source>
<target>該值應小於或等於 {{ compared_value }} 。</target>
</trans-unit>
<trans-unit id="71">
<source>This value should not be equal to {{ compared_value }}.</source>
<target>該值應不等於 {{ compared_value }} 。</target>
</trans-unit>
<trans-unit id="72">
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>該值不應與 {{ compared_value_type }} {{ compared_value }} 相同。</target>
</trans-unit>
</body>
</file>
</xliff>