Skip to content

Commit 08333ec

Browse files
committed
[Security] sync translations and add a test for it
1 parent 8d3bf03 commit 08333ec

File tree

4 files changed

+72
-6
lines changed

4 files changed

+72
-6
lines changed

src/Symfony/Component/Security/Core/Resources/translations/security.tr.xlf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
</trans-unit>
99
<trans-unit id="2">
1010
<source>Authentication credentials could not be found.</source>
11-
<target>Yetkilendirme girdileri bulunamadı.</target>
11+
<target>Kimlik bilgileri bulunamadı.</target>
1212
</trans-unit>
1313
<trans-unit id="3">
1414
<source>Authentication request could not be processed due to a system problem.</source>
1515
<target>Bir sistem hatası nedeniyle yetkilendirme isteği işleme alınamıyor.</target>
1616
</trans-unit>
1717
<trans-unit id="4">
1818
<source>Invalid credentials.</source>
19-
<target>Geçersiz girdiler.</target>
19+
<target>Geçersiz kimlik bilgileri.</target>
2020
</trans-unit>
2121
<trans-unit id="5">
2222
<source>Cookie has already been used by someone else.</source>
@@ -32,7 +32,7 @@
3232
</trans-unit>
3333
<trans-unit id="8">
3434
<source>Digest nonce has expired.</source>
35-
<target>Derleme zaman aşımı gerçekleşti.</target>
35+
<target>Derleme zaman aşımına uğradı.</target>
3636
</trans-unit>
3737
<trans-unit id="9">
3838
<source>No authentication provider found to support the authentication token.</source>
@@ -44,7 +44,7 @@
4444
</trans-unit>
4545
<trans-unit id="11">
4646
<source>No token could be found.</source>
47-
<target>Bilet bulunamadı.</target>
47+
<target>Fiş bulunamadı.</target>
4848
</trans-unit>
4949
<trans-unit id="12">
5050
<source>Username could not be found.</source>
@@ -56,11 +56,11 @@
5656
</trans-unit>
5757
<trans-unit id="14">
5858
<source>Credentials have expired.</source>
59-
<target>Girdiler zaman aşımına uğradı.</target>
59+
<target>Kimlik bilgileri zaman aşımına uğradı.</target>
6060
</trans-unit>
6161
<trans-unit id="15">
6262
<source>Account is disabled.</source>
63-
<target>Hesap devre dışı bırakılmış.</target>
63+
<target>Hesap engellenmiş.</target>
6464
</trans-unit>
6565
<trans-unit id="16">
6666
<source>Account is locked.</source>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Security\Tests;
13+
14+
use Symfony\Component\Finder\Finder;
15+
16+
class TranslationSyncStatusTest extends \PHPUnit_Framework_TestCase
17+
{
18+
/**
19+
* @dataProvider getTranslationDirectoriesData
20+
*/
21+
public function testTranslationFileIsNotMissingInCore($dir1, $dir2)
22+
{
23+
$finder = new Finder();
24+
$files = $finder->in($dir1)->files();
25+
26+
foreach ($files as $file) {
27+
$this->assertFileExists($dir2.'/'.$file->getFilename(), 'Missing file '.$file->getFilename().' in directory '.$dir2);
28+
}
29+
}
30+
31+
public function getTranslationDirectoriesData()
32+
{
33+
$legacyTranslationsDir = $this->getLegacyTranslationsDirectory();
34+
$coreTranslationsDir = $this->getCoreTranslationsDirectory();
35+
36+
return array(
37+
'file-not-missing-in-core' => array($legacyTranslationsDir, $coreTranslationsDir),
38+
'file-not-added-in-core' => array($coreTranslationsDir, $legacyTranslationsDir),
39+
);
40+
}
41+
42+
public function testFileContentsAreEqual()
43+
{
44+
$finder = new Finder();
45+
$files = $finder->in($this->getLegacyTranslationsDirectory())->files();
46+
47+
foreach ($files as $file) {
48+
$coreFile = $this->getCoreTranslationsDirectory().'/'.$file->getFilename();
49+
50+
$this->assertFileEquals($file->getRealPath(), $coreFile, $file.' and '.$coreFile.' have equal content.');
51+
}
52+
}
53+
54+
private function getLegacyTranslationsDirectory()
55+
{
56+
return __DIR__.'/../Resources/translations';
57+
}
58+
59+
private function getCoreTranslationsDirectory()
60+
{
61+
return __DIR__.'/../Core/Resources/translations';
62+
}
63+
}

src/Symfony/Component/Security/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"symfony/security-http": "self.version"
2929
},
3030
"require-dev": {
31+
"symfony/finder": "~2.3",
3132
"symfony/phpunit-bridge": "~2.7",
3233
"symfony/intl": "~2.3",
3334
"symfony/routing": "~2.2",

src/Symfony/Component/Security/phpunit.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<testsuites>
1414
<testsuite name="Symfony Security Component Test Suite">
15+
<directory>./Tests/</directory>
1516
<directory>./Acl/Tests/</directory>
1617
<directory>./Core/Tests/</directory>
1718
<directory>./Http/Tests/</directory>
@@ -23,6 +24,7 @@
2324
<directory>./</directory>
2425
<exclude>
2526
<directory>./vendor</directory>
27+
<directory>./Tests</directory>
2628
<directory>./Acl/Tests</directory>
2729
<directory>./Core/Tests</directory>
2830
<directory>./Http/Tests</directory>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy