Skip to content

Commit 30bc1ae

Browse files
Merge branch '3.4' into 4.0
* 3.4: [HttpKernel] DebugHandlersListener should always replace the existing exception handler fix the Composer API being used [Security] Notify that symfony/expression-language is not installed if ExpressionLanguage and ExpressionLanguagePrivider are used [Debug] Always decorate existing exception handlers to deal with fatal errors Enableable ArrayNodeDefinition is disabled for empty configuration Fixing a bug where the dump() function depended on bundle ordering [Cache] Fix handling of apcu_fetch() edgy behavior Add nn (Norwegian Nynorsk) translation files, and improve existing file Problem in phar see mergerequest #25579 [Form] Disallow transform dates beyond the year 9999 Avoid button label translation when it's set to false Copied NO language files to the new NB locale. [Serializer] DateTimeNormalizer handling of null and empty values (returning null or empty instead of new object) Fix options resolver with array allowed types [Console] Improve phpdoc on StyleInterface::ask() [TwigBridge][WIP] Pass the form-check-inline in parent
2 parents 35452af + 4f2c1e3 commit 30bc1ae

File tree

4 files changed

+169
-14
lines changed

4 files changed

+169
-14
lines changed

Authorization/ExpressionLanguage.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,27 @@
1414
use Psr\Cache\CacheItemPoolInterface;
1515
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
1616

17-
/**
18-
* Adds some function to the default ExpressionLanguage.
19-
*
20-
* @author Fabien Potencier <[email protected]>
21-
*
22-
* @see ExpressionLanguageProvider
23-
*/
24-
class ExpressionLanguage extends BaseExpressionLanguage
25-
{
17+
if (!class_exists(BaseExpressionLanguage::class)) {
18+
throw new \LogicException(sprintf('The "%s" class requires the "ExpressionLanguage" component. Try running "composer require symfony/expression-language".', ExpressionLanguage::class));
19+
} else {
2620
/**
27-
* {@inheritdoc}
21+
* Adds some function to the default ExpressionLanguage.
22+
*
23+
* @author Fabien Potencier <[email protected]>
24+
*
25+
* @see ExpressionLanguageProvider
2826
*/
29-
public function __construct(CacheItemPoolInterface $cache = null, array $providers = array())
27+
class ExpressionLanguage extends BaseExpressionLanguage
3028
{
31-
// prepend the default provider to let users override it easily
32-
array_unshift($providers, new ExpressionLanguageProvider());
29+
/**
30+
* {@inheritdoc}
31+
*/
32+
public function __construct(CacheItemPoolInterface $cache = null, array $providers = array())
33+
{
34+
// prepend the default provider to let users override it easily
35+
array_unshift($providers, new ExpressionLanguageProvider());
3336

34-
parent::__construct($cache, $providers);
37+
parent::__construct($cache, $providers);
38+
}
3539
}
3640
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="file.ext">
4+
<body>
5+
<trans-unit id="1">
6+
<source>An authentication exception occurred.</source>
7+
<target>En autentiseringsfeil har skjedd.</target>
8+
</trans-unit>
9+
<trans-unit id="2">
10+
<source>Authentication credentials could not be found.</source>
11+
<target>Påloggingsinformasjonen kunne ikke bli funnet.</target>
12+
</trans-unit>
13+
<trans-unit id="3">
14+
<source>Authentication request could not be processed due to a system problem.</source>
15+
<target>Autentiserings forespørselen kunne ikke bli prosessert grunnet en system feil.</target>
16+
</trans-unit>
17+
<trans-unit id="4">
18+
<source>Invalid credentials.</source>
19+
<target>Ugyldig påloggingsinformasjonen.</target>
20+
</trans-unit>
21+
<trans-unit id="5">
22+
<source>Cookie has already been used by someone else.</source>
23+
<target>Cookie har allerede blitt brukt av noen andre.</target>
24+
</trans-unit>
25+
<trans-unit id="6">
26+
<source>Not privileged to request the resource.</source>
27+
<target>Ingen tilgang til å be om gitt ressurs.</target>
28+
</trans-unit>
29+
<trans-unit id="7">
30+
<source>Invalid CSRF token.</source>
31+
<target>Ugyldig CSRF token.</target>
32+
</trans-unit>
33+
<trans-unit id="8">
34+
<source>Digest nonce has expired.</source>
35+
<target>Digest nonce er utløpt.</target>
36+
</trans-unit>
37+
<trans-unit id="9">
38+
<source>No authentication provider found to support the authentication token.</source>
39+
<target>Ingen autentiserings tilbyder funnet som støtter gitt autentiserings token.</target>
40+
</trans-unit>
41+
<trans-unit id="10">
42+
<source>No session available, it either timed out or cookies are not enabled.</source>
43+
<target>Ingen sesjon tilgjengelig, sesjonen er enten utløpt eller cookies ikke skrudd på.</target>
44+
</trans-unit>
45+
<trans-unit id="11">
46+
<source>No token could be found.</source>
47+
<target>Ingen token kunne bli funnet.</target>
48+
</trans-unit>
49+
<trans-unit id="12">
50+
<source>Username could not be found.</source>
51+
<target>Brukernavn kunne ikke bli funnet.</target>
52+
</trans-unit>
53+
<trans-unit id="13">
54+
<source>Account has expired.</source>
55+
<target>Brukerkonto har utgått.</target>
56+
</trans-unit>
57+
<trans-unit id="14">
58+
<source>Credentials have expired.</source>
59+
<target>Påloggingsinformasjon har utløpt.</target>
60+
</trans-unit>
61+
<trans-unit id="15">
62+
<source>Account is disabled.</source>
63+
<target>Brukerkonto er deaktivert.</target>
64+
</trans-unit>
65+
<trans-unit id="16">
66+
<source>Account is locked.</source>
67+
<target>Brukerkonto er sperret.</target>
68+
</trans-unit>
69+
</body>
70+
</file>
71+
</xliff>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="file.ext">
4+
<body>
5+
<trans-unit id="1">
6+
<source>An authentication exception occurred.</source>
7+
<target>Innlogginga har feila.</target>
8+
</trans-unit>
9+
<trans-unit id="2">
10+
<source>Authentication credentials could not be found.</source>
11+
<target>Innloggingsinformasjonen vart ikkje funnen.</target>
12+
</trans-unit>
13+
<trans-unit id="3">
14+
<source>Authentication request could not be processed due to a system problem.</source>
15+
<target>Innlogginga vart ikkje fullført på grunn av ein systemfeil.</target>
16+
</trans-unit>
17+
<trans-unit id="4">
18+
<source>Invalid credentials.</source>
19+
<target>Ugyldig innloggingsinformasjon.</target>
20+
</trans-unit>
21+
<trans-unit id="5">
22+
<source>Cookie has already been used by someone else.</source>
23+
<target>Informasjonskapselen er allereie brukt av ein annan brukar.</target>
24+
</trans-unit>
25+
<trans-unit id="6">
26+
<source>Not privileged to request the resource.</source>
27+
<target>Du har ikkje åtgang til å be om denne ressursen.</target>
28+
</trans-unit>
29+
<trans-unit id="7">
30+
<source>Invalid CSRF token.</source>
31+
<target>Ugyldig CSRF-teikn.</target>
32+
</trans-unit>
33+
<trans-unit id="8">
34+
<source>Digest nonce has expired.</source>
35+
<target>Digest nonce er ikkje lenger gyldig.</target>
36+
</trans-unit>
37+
<trans-unit id="9">
38+
<source>No authentication provider found to support the authentication token.</source>
39+
<target>Fann ingen innloggingstilbydar som støttar dette innloggingsteiknet.</target>
40+
</trans-unit>
41+
<trans-unit id="10">
42+
<source>No session available, it either timed out or cookies are not enabled.</source>
43+
<target>Ingen sesjon tilgjengeleg. Sesjonen er anten ikkje lenger gyldig, eller informasjonskapslar er ikke skrudd på i nettlesaren.</target>
44+
</trans-unit>
45+
<trans-unit id="11">
46+
<source>No token could be found.</source>
47+
<target>Fann ingen innloggingsteikn.</target>
48+
</trans-unit>
49+
<trans-unit id="12">
50+
<source>Username could not be found.</source>
51+
<target>Fann ikkje brukarnamnet.</target>
52+
</trans-unit>
53+
<trans-unit id="13">
54+
<source>Account has expired.</source>
55+
<target>Brukarkontoen er utgjengen.</target>
56+
</trans-unit>
57+
<trans-unit id="14">
58+
<source>Credentials have expired.</source>
59+
<target>Innloggingsinformasjonen er utgjengen.</target>
60+
</trans-unit>
61+
<trans-unit id="15">
62+
<source>Account is disabled.</source>
63+
<target>Brukarkontoen er deaktivert.</target>
64+
</trans-unit>
65+
<trans-unit id="16">
66+
<source>Account is locked.</source>
67+
<target>Brukarkontoen er sperra.</target>
68+
</trans-unit>
69+
</body>
70+
</file>
71+
</xliff>

Tests/Resources/TranslationFilesTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,13 @@ function ($filePath) { return (array) $filePath; },
3636
glob(dirname(dirname(__DIR__)).'/Resources/translations/*.xlf')
3737
);
3838
}
39+
40+
public function testNorwegianAlias()
41+
{
42+
$this->assertFileEquals(
43+
dirname(dirname(__DIR__)).'/Resources/translations/security.nb.xlf',
44+
dirname(dirname(__DIR__)).'/Resources/translations/security.no.xlf',
45+
'The NO locale should be an alias for the NB variant of the Norwegian language.'
46+
);
47+
}
3948
}

0 commit comments

Comments
 (0)