Skip to content

Commit 56d1f3e

Browse files
committed
feature symfony#25295 [Translation] Parse PHP constants in YAML translation files (ostrolucky)
This PR was merged into the 4.1-dev branch. Discussion ---------- [Translation] Parse PHP constants in YAML translation files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- d2c8532 [Translator] Parse PHP constants in YAML translation files
2 parents 0252116 + d2c8532 commit 56d1f3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Translation/Loader/YamlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Translation\Exception\LogicException;
1616
use Symfony\Component\Yaml\Parser as YamlParser;
1717
use Symfony\Component\Yaml\Exception\ParseException;
18+
use Symfony\Component\Yaml\Yaml;
1819

1920
/**
2021
* YamlFileLoader loads translations from Yaml files.
@@ -39,7 +40,7 @@ protected function loadResource($resource)
3940
}
4041

4142
try {
42-
$messages = $this->yamlParser->parseFile($resource);
43+
$messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT);
4344
} catch (ParseException $e) {
4445
throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $resource), 0, $e);
4546
}

0 commit comments

Comments
 (0)