Merge branch '3.4' into 4.4

* 3.4:
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  add vietnamese translation for html5 color validation
This commit is contained in:
Nicolas Grekas 2020-07-12 12:26:44 +02:00
commit c4e47fdd65
10 changed files with 376 additions and 17 deletions

View File

@ -81,7 +81,11 @@ class DoctrineTokenProvider implements TokenProviderInterface
$sql = 'DELETE FROM rememberme_token WHERE series=:series';
$paramValues = ['series' => $series];
$paramTypes = ['series' => \PDO::PARAM_STR];
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
if (method_exists($this->conn, 'executeStatement')) {
$this->conn->executeStatement($sql, $paramValues, $paramTypes);
} else {
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
}
}
/**
@ -101,7 +105,11 @@ class DoctrineTokenProvider implements TokenProviderInterface
'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE,
'series' => \PDO::PARAM_STR,
];
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
if (method_exists($this->conn, 'executeStatement')) {
$updated = $this->conn->executeStatement($sql, $paramValues, $paramTypes);
} else {
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
}
if ($updated < 1) {
throw new TokenNotFoundException('No token found.');
}
@ -129,6 +137,10 @@ class DoctrineTokenProvider implements TokenProviderInterface
'value' => \PDO::PARAM_STR,
'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE,
];
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
if (method_exists($this->conn, 'executeStatement')) {
$this->conn->executeStatement($sql, $paramValues, $paramTypes);
} else {
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
}
}
}

View File

@ -72,7 +72,7 @@ class DoctrineTokenProviderTest extends TestCase
'driver' => 'pdo_sqlite',
'url' => 'sqlite:///:memory:',
]);
$connection->executeUpdate(<<< 'SQL'
$connection->{method_exists($this->conn, 'executeStatement') ? 'executeStatement' : 'executeUpdate'}(<<< 'SQL'
CREATE TABLE rememberme_token (
series char(88) UNIQUE PRIMARY KEY NOT NULL,
value char(88) NOT NULL,

View File

@ -113,7 +113,11 @@ trait PdoTrait
$table->setPrimaryKey([$this->idCol]);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql);
if (method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
}
}
return;
@ -144,7 +148,11 @@ trait PdoTrait
throw new \DomainException(sprintf('Creating the cache table is currently not implemented for PDO driver "%s".', $this->driver));
}
$conn->exec($sql);
if (method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
}
}
/**
@ -256,7 +264,11 @@ trait PdoTrait
}
try {
$conn->exec($sql);
if (method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
}
} catch (TableNotFoundException $e) {
} catch (\PDOException $e) {
}

View File

@ -368,7 +368,7 @@ class ChoiceType extends AbstractType
'value' => $choiceView->value,
'label' => $choiceView->label,
'attr' => $choiceView->attr,
'translation_domain' => $options['translation_domain'],
'translation_domain' => $options['choice_translation_domain'],
'block_name' => 'entry',
];

View File

@ -18,6 +18,102 @@
<source>This value is not a valid HTML5 color.</source>
<target>This value is not a valid HTML5 color.</target>
</trans-unit>
<trans-unit id="100">
<source>Please enter a valid birthdate.</source>
<target>Please enter a valid birthdate.</target>
</trans-unit>
<trans-unit id="101">
<source>The selected choice is invalid.</source>
<target>The selected choice is invalid.</target>
</trans-unit>
<trans-unit id="102">
<source>The collection is invalid.</source>
<target>The collection is invalid.</target>
</trans-unit>
<trans-unit id="103">
<source>Please select a valid color.</source>
<target>Please select a valid color.</target>
</trans-unit>
<trans-unit id="104">
<source>Please select a valid country.</source>
<target>Please select a valid country.</target>
</trans-unit>
<trans-unit id="105">
<source>Please select a valid currency.</source>
<target>Please select a valid currency.</target>
</trans-unit>
<trans-unit id="106">
<source>Please choose a valid date interval.</source>
<target>Please choose a valid date interval.</target>
</trans-unit>
<trans-unit id="107">
<source>Please enter a valid date and time.</source>
<target>Please enter a valid date and time.</target>
</trans-unit>
<trans-unit id="108">
<source>Please enter a valid date.</source>
<target>Please enter a valid date.</target>
</trans-unit>
<trans-unit id="109">
<source>Please select a valid file.</source>
<target>Please select a valid file.</target>
</trans-unit>
<trans-unit id="110">
<source>The hidden field is invalid.</source>
<target>The hidden field is invalid.</target>
</trans-unit>
<trans-unit id="111">
<source>Please enter an integer.</source>
<target>Please enter an integer.</target>
</trans-unit>
<trans-unit id="112">
<source>Please select a valid language.</source>
<target>Please select a valid language.</target>
</trans-unit>
<trans-unit id="113">
<source>Please select a valid locale.</source>
<target>Please select a valid locale.</target>
</trans-unit>
<trans-unit id="114">
<source>Please enter a valid money amount.</source>
<target>Please enter a valid money amount.</target>
</trans-unit>
<trans-unit id="115">
<source>Please enter a number.</source>
<target>Please enter a number.</target>
</trans-unit>
<trans-unit id="116">
<source>The password is invalid.</source>
<target>The password is invalid.</target>
</trans-unit>
<trans-unit id="117">
<source>Please enter a percentage value.</source>
<target>Please enter a percentage value.</target>
</trans-unit>
<trans-unit id="118">
<source>The values do not match.</source>
<target>The values do not match.</target>
</trans-unit>
<trans-unit id="119">
<source>Please enter a valid time.</source>
<target>Please enter a valid time.</target>
</trans-unit>
<trans-unit id="120">
<source>Please select a valid timezone.</source>
<target>Please select a valid timezone.</target>
</trans-unit>
<trans-unit id="121">
<source>Please enter a valid URL.</source>
<target>Please enter a valid URL.</target>
</trans-unit>
<trans-unit id="122">
<source>Please enter a valid search term.</source>
<target>Please enter a valid search term.</target>
</trans-unit>
<trans-unit id="123">
<source>Please provide a valid phone number.</source>
<target>Please provide a valid phone number.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -14,6 +14,106 @@
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
<target>Hindi balido ang CSRF token. Maagpasa muli ng isang pang porma.</target>
</trans-unit>
<trans-unit id="99">
<source>This value is not a valid HTML5 color.</source>
<target>Ang halagang ito ay hindi wastong HTML5 color.</target>
</trans-unit>
<trans-unit id="100">
<source>Please enter a valid birthdate.</source>
<target>Pakilagay ang tamang petsa ng kapanganakan.</target>
</trans-unit>
<trans-unit id="101">
<source>The selected choice is invalid.</source>
<target>Ang pinagpiliang sagot ay hindi tama.</target>
</trans-unit>
<trans-unit id="102">
<source>The collection is invalid.</source>
<target>Hindi balido ang koleksyon.</target>
</trans-unit>
<trans-unit id="103">
<source>Please select a valid color.</source>
<target>Pakipiliin ang nararapat na kulay.</target>
</trans-unit>
<trans-unit id="104">
<source>Please select a valid country.</source>
<target>Pakipiliin ang nararapat na bansa.</target>
</trans-unit>
<trans-unit id="105">
<source>Please select a valid currency.</source>
<target>Pakipiliin ang tamang pananalapi.</target>
</trans-unit>
<trans-unit id="106">
<source>Please choose a valid date interval.</source>
<target>Piliin ang wastong agwat ng petsa.</target>
</trans-unit>
<trans-unit id="107">
<source>Please enter a valid date and time.</source>
<target>Piliin ang wastong petsa at oras.</target>
</trans-unit>
<trans-unit id="108">
<source>Please enter a valid date.</source>
<target>Ilagay ang wastong petsa.</target>
</trans-unit>
<trans-unit id="109">
<source>Please select a valid file.</source>
<target>Piliin ang balidong file.</target>
</trans-unit>
<trans-unit id="110">
<source>The hidden field is invalid.</source>
<target>Hindi balido ang field na nakatago.</target>
</trans-unit>
<trans-unit id="111">
<source>Please enter an integer.</source>
<target>Pakilagay ang integer.</target>
</trans-unit>
<trans-unit id="112">
<source>Please select a valid language.</source>
<target>Piliin ang nararapat na lengguwahe.</target>
</trans-unit>
<trans-unit id="113">
<source>Please select a valid locale.</source>
<target>Pakipili ang nararapat na locale.</target>
</trans-unit>
<trans-unit id="114">
<source>Please enter a valid money amount.</source>
<target>Pakilagay ang tamang halaga ng pera.</target>
</trans-unit>
<trans-unit id="115">
<source>Please enter a number.</source>
<target>Ilagay ang numero.</target>
</trans-unit>
<trans-unit id="116">
<source>The password is invalid.</source>
<target>Hindi balido ang password.</target>
</trans-unit>
<trans-unit id="117">
<source>Please enter a percentage value.</source>
<target>Pakilagay ang tamang porsyento ng halaga.</target>
</trans-unit>
<trans-unit id="118">
<source>The values do not match.</source>
<target>Hindi tugma ang mga halaga.</target>
</trans-unit>
<trans-unit id="119">
<source>Please enter a valid time.</source>
<target>Pakilagay ang tamang oras.</target>
</trans-unit>
<trans-unit id="120">
<source>Please select a valid timezone.</source>
<target>Pakilagay ang tamang sona ng oras.</target>
</trans-unit>
<trans-unit id="121">
<source>Please enter a valid URL.</source>
<target>Pakilagay ang balidong URL.</target>
</trans-unit>
<trans-unit id="122">
<source>Please enter a valid search term.</source>
<target>Pakilagay ang balidong katagang sinasaliksik.</target>
</trans-unit>
<trans-unit id="123">
<source>Please provide a valid phone number.</source>
<target>Pakilagay ang balidong numero ng telepono.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -4,7 +4,7 @@
<body>
<trans-unit id="28">
<source>This form should not contain extra fields.</source>
<target>Mẫu này không nên chứa trường mở rộng</target>
<target>Mẫu này không nên chứa trường mở rộng.</target>
</trans-unit>
<trans-unit id="29">
<source>The uploaded file was too large. Please try to upload a smaller file.</source>
@ -14,6 +14,106 @@
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
<target>CSRF token không hợp lệ. Vui lòng thử lại.</target>
</trans-unit>
<trans-unit id="99">
<source>This value is not a valid HTML5 color.</source>
<target>Giá trị này không phải là màu HTML5 hợp lệ.</target>
</trans-unit>
<trans-unit id="100">
<source>Please enter a valid birthdate.</source>
<target>Vui lòng nhập ngày sinh hợp lệ.</target>
</trans-unit>
<trans-unit id="101">
<source>The selected choice is invalid.</source>
<target>Lựa chọn không hợp lệ.</target>
</trans-unit>
<trans-unit id="102">
<source>The collection is invalid.</source>
<target>Danh sách không hợp lệ.</target>
</trans-unit>
<trans-unit id="103">
<source>Please select a valid color.</source>
<target>Vui lòng chọn một màu hợp lệ.</target>
</trans-unit>
<trans-unit id="104">
<source>Please select a valid country.</source>
<target>Vui lòng chọn đất nước hợp lệ.</target>
</trans-unit>
<trans-unit id="105">
<source>Please select a valid currency.</source>
<target>Vui lòng chọn tiền tệ hợp lệ.</target>
</trans-unit>
<trans-unit id="106">
<source>Please choose a valid date interval.</source>
<target>Vui lòng chọn một khoảng thời gian hợp lệ.</target>
</trans-unit>
<trans-unit id="107">
<source>Please enter a valid date and time.</source>
<target>Vui lòng nhập ngày và thời gian hợp lệ.</target>
</trans-unit>
<trans-unit id="108">
<source>Please enter a valid date.</source>
<target>Vui lòng nhập ngày hợp lệ.</target>
</trans-unit>
<trans-unit id="109">
<source>Please select a valid file.</source>
<target>Vui lòng chọn tệp hợp lệ.</target>
</trans-unit>
<trans-unit id="110">
<source>The hidden field is invalid.</source>
<target>Phạm vi ẩn không hợp lệ.</target>
</trans-unit>
<trans-unit id="111">
<source>Please enter an integer.</source>
<target>Vui lòng nhập một số nguyên.</target>
</trans-unit>
<trans-unit id="112">
<source>Please select a valid language.</source>
<target>Vui lòng chọn ngôn ngữ hợp lệ.</target>
</trans-unit>
<trans-unit id="113">
<source>Please select a valid locale.</source>
<target>Vui lòng chọn miền hợp lệ.</target>
</trans-unit>
<trans-unit id="114">
<source>Please enter a valid money amount.</source>
<target>Vui lòng nhập một khoảng tiền hợp lệ.</target>
</trans-unit>
<trans-unit id="115">
<source>Please enter a number.</source>
<target>Vui lòng nhập một con số.</target>
</trans-unit>
<trans-unit id="116">
<source>The password is invalid.</source>
<target>Mật khẩu không hợp lệ.</target>
</trans-unit>
<trans-unit id="117">
<source>Please enter a percentage value.</source>
<target>Vui lòng nhập một giá trị phần trăm.</target>
</trans-unit>
<trans-unit id="118">
<source>The values do not match.</source>
<target>Các giá trị không phù hợp.</target>
</trans-unit>
<trans-unit id="119">
<source>Please enter a valid time.</source>
<target>Vui lòng nhập thời gian hợp lệ.</target>
</trans-unit>
<trans-unit id="120">
<source>Please select a valid timezone.</source>
<target>Vui lòng chọn múi giờ hợp lệ.</target>
</trans-unit>
<trans-unit id="121">
<source>Please enter a valid URL.</source>
<target>Vui lòng nhập một URL hợp lệ.</target>
</trans-unit>
<trans-unit id="122">
<source>Please enter a valid search term.</source>
<target>Vui lòng nhập chuỗi tìm kiếm hợp lệ.</target>
</trans-unit>
<trans-unit id="123">
<source>Please provide a valid phone number.</source>
<target>Vui lòng cung cấp số điện thoại hợp lệ.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -1997,6 +1997,24 @@ class ChoiceTypeTest extends BaseTypeTest
$this->assertEquals('_09name', $view->vars['full_name']);
}
public function testSubFormTranslationDomain()
{
$form = $this->factory->create(static::TESTED_TYPE, null, [
'label' => 'label',
'translation_domain' => 'label_translation_domain',
'choices' => [
'choice1' => true,
'choice2' => false,
],
'choice_translation_domain' => 'choice_translation_domain',
'expanded' => true,
])->createView();
$this->assertCount(2, $form->children);
$this->assertSame('choice_translation_domain', $form->children[0]->vars['translation_domain']);
$this->assertSame('choice_translation_domain', $form->children[1]->vars['translation_domain']);
}
/**
* @dataProvider provideTrimCases
*/

View File

@ -267,7 +267,11 @@ class PdoStore implements StoreInterface
$table->setPrimaryKey([$this->idCol]);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql);
if (method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
}
}
return;
@ -293,7 +297,11 @@ class PdoStore implements StoreInterface
throw new \DomainException(sprintf('Creating the lock table is currently not implemented for PDO driver "%s".', $driver));
}
$conn->exec($sql);
if (method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
}
}
/**
@ -303,7 +311,12 @@ class PdoStore implements StoreInterface
{
$sql = "DELETE FROM $this->table WHERE $this->expirationCol <= {$this->getCurrentTimestampStatement()}";
$this->getConnection()->exec($sql);
$conn = $this->getConnection();
if (method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
}
}
private function getDriver(): string

View File

@ -126,7 +126,7 @@ class Connection
'available_at' => '?',
]);
$this->executeUpdate($queryBuilder->getSQL(), [
$this->executeStatement($queryBuilder->getSQL(), [
$body,
json_encode($headers),
$this->configuration['queue_name'],
@ -179,7 +179,7 @@ class Connection
->set('delivered_at', '?')
->where('id = ?');
$now = new \DateTime();
$this->executeUpdate($queryBuilder->getSQL(), [
$this->executeStatement($queryBuilder->getSQL(), [
$now,
$doctrineEnvelope['id'],
], [
@ -329,10 +329,14 @@ class Connection
return $stmt;
}
private function executeUpdate(string $sql, array $parameters = [], array $types = [])
private function executeStatement(string $sql, array $parameters = [], array $types = [])
{
try {
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
if (method_exists($this->driverConnection, 'executeStatement')) {
$stmt = $this->driverConnection->executeStatement($sql, $parameters, $types);
} else {
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
}
} catch (TableNotFoundException $e) {
if ($this->driverConnection->isTransactionActive()) {
throw $e;
@ -342,7 +346,11 @@ class Connection
if ($this->autoSetup) {
$this->setup();
}
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
if (method_exists($this->driverConnection, 'executeStatement')) {
$stmt = $this->driverConnection->executeStatement($sql, $parameters, $types);
} else {
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
}
}
return $stmt;