Skip to content

[Security] sync translations and add a test for it #16146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
</trans-unit>
<trans-unit id="2">
<source>Authentication credentials could not be found.</source>
<target>Yetkilendirme girdileri bulunamadı.</target>
<target>Kimlik bilgileri bulunamadı.</target>
</trans-unit>
<trans-unit id="3">
<source>Authentication request could not be processed due to a system problem.</source>
<target>Bir sistem hatası nedeniyle yetkilendirme isteği işleme alınamıyor.</target>
</trans-unit>
<trans-unit id="4">
<source>Invalid credentials.</source>
<target>Geçersiz girdiler.</target>
<target>Geçersiz kimlik bilgileri.</target>
</trans-unit>
<trans-unit id="5">
<source>Cookie has already been used by someone else.</source>
Expand All @@ -32,7 +32,7 @@
</trans-unit>
<trans-unit id="8">
<source>Digest nonce has expired.</source>
<target>Derleme zaman aşımı gerçekleşti.</target>
<target>Derleme zaman aşımına uğradı.</target>
</trans-unit>
<trans-unit id="9">
<source>No authentication provider found to support the authentication token.</source>
Expand All @@ -44,7 +44,7 @@
</trans-unit>
<trans-unit id="11">
<source>No token could be found.</source>
<target>Bilet bulunamadı.</target>
<target>Fiş bulunamadı.</target>
</trans-unit>
<trans-unit id="12">
<source>Username could not be found.</source>
Expand All @@ -56,11 +56,11 @@
</trans-unit>
<trans-unit id="14">
<source>Credentials have expired.</source>
<target>Girdiler zaman aşımına uğradı.</target>
<target>Kimlik bilgileri zaman aşımına uğradı.</target>
</trans-unit>
<trans-unit id="15">
<source>Account is disabled.</source>
<target>Hesap devre dışı bırakılmış.</target>
<target>Hesap engellenmiş.</target>
</trans-unit>
<trans-unit id="16">
<source>Account is locked.</source>
Expand Down
63 changes: 63 additions & 0 deletions src/Symfony/Component/Security/Tests/TranslationSyncStatusTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Security\Tests;

use Symfony\Component\Finder\Finder;

class TranslationSyncStatusTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider getTranslationDirectoriesData
*/
public function testTranslationFileIsNotMissingInCore($dir1, $dir2)
{
$finder = new Finder();
$files = $finder->in($dir1)->files();

foreach ($files as $file) {
$this->assertFileExists($dir2.'/'.$file->getFilename(), 'Missing file '.$file->getFilename().' in directory '.$dir2);
}
}

public function getTranslationDirectoriesData()
{
$legacyTranslationsDir = $this->getLegacyTranslationsDirectory();
$coreTranslationsDir = $this->getCoreTranslationsDirectory();

return array(
'file-not-missing-in-core' => array($legacyTranslationsDir, $coreTranslationsDir),
'file-not-added-in-core' => array($coreTranslationsDir, $legacyTranslationsDir),
);
}

public function testFileContentsAreEqual()
{
$finder = new Finder();
$files = $finder->in($this->getLegacyTranslationsDirectory())->files();

foreach ($files as $file) {
$coreFile = $this->getCoreTranslationsDirectory().'/'.$file->getFilename();

$this->assertFileEquals($file->getRealPath(), $coreFile, $file.' and '.$coreFile.' have equal content.');
}
}

private function getLegacyTranslationsDirectory()
{
return __DIR__.'/../Resources/translations';
}

private function getCoreTranslationsDirectory()
{
return __DIR__.'/../Core/Resources/translations';
}
}
1 change: 1 addition & 0 deletions src/Symfony/Component/Security/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"symfony/security-http": "self.version"
},
"require-dev": {
"symfony/finder": "~2.3",
"symfony/phpunit-bridge": "~2.7",
"symfony/intl": "~2.3",
"symfony/routing": "~2.2",
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Security/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<testsuites>
<testsuite name="Symfony Security Component Test Suite">
<directory>./Tests/</directory>
<directory>./Acl/Tests/</directory>
<directory>./Core/Tests/</directory>
<directory>./Http/Tests/</directory>
Expand All @@ -23,6 +24,7 @@
<directory>./</directory>
<exclude>
<directory>./vendor</directory>
<directory>./Tests</directory>
<directory>./Acl/Tests</directory>
<directory>./Core/Tests</directory>
<directory>./Http/Tests</directory>
Expand Down
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