Skip to content

Commit 2bc9475

Browse files
enumagfprochazka
authored andcommitted
Allow Symfony 3.x
Fix NeonFileDumper Fix Translator [Closes #137] [Closes #118]
1 parent 0400e8b commit 2bc9475

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"nette/utils": "^2.4@dev|^3.0@dev",
2929

3030
"psr/log": "^1.0",
31-
"symfony/translation": "~2.5",
32-
"symfony/config": "~2.5"
31+
"symfony/translation": "^2.5|^3.0",
32+
"symfony/config": "^2.5|^3.0"
3333
},
3434
"suggest": {
3535
"kdyby/console": "If you wanna use extract command and much others, install also console.",
@@ -45,7 +45,7 @@
4545
"tracy/tracy": "^2.4@dev",
4646

4747
"kdyby/monolog": "^1.2@dev",
48-
"symfony/console": "~2.3",
48+
"symfony/console": "^2.3|^3.0",
4949
"nette/tester": "~1.4",
5050
"mockery/mockery": "~0.9"
5151
},

src/Kdyby/Translation/Dumper/NeonFileDumper.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424
class NeonFileDumper extends FileDumper
2525
{
2626

27+
/**
28+
* {@inheritDoc}
29+
*/
30+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = [])
31+
{
32+
return Neon::encode($messages->all($domain), Neon::BLOCK);
33+
}
34+
35+
36+
2737
/**
2838
* {@inheritDoc}
2939
*/

src/Kdyby/Translation/Translator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ public function getAvailableLocales()
327327
*/
328328
public function getLocale()
329329
{
330-
if ($this->locale === NULL) {
330+
if (parent::getLocale() === NULL) {
331331
$this->setLocale($this->localeResolver->resolve($this));
332332
}
333333

334-
return $this->locale;
334+
return parent::getLocale();
335335
}
336336

337337

0 commit comments

Comments
 (0)