Skip to content

Commit dd38540

Browse files
committed
bug #16146 [Security] sync translations and add a test for it (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [Security] sync translations and add a test for it | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15955 | License | MIT | Doc PR | Commits ------- 08333ec [Security] sync translations and add a test for it
2 parents 99bf879 + 08333ec commit dd38540

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

+6-6
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>
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

+1
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

+2
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)