Skip to content

Commit

Permalink
Merge pull request #139 from jtojnar/array-loader
Browse files Browse the repository at this point in the history
Support array loader
  • Loading branch information
fprochazka authored Jun 12, 2017
2 parents 03890a1 + e978c3a commit 196e246
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/DI/config/loaders.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
array: Symfony\Component\Translation\Loader\ArrayLoader
php: Symfony\Component\Translation\Loader\PhpFileLoader
yml: Symfony\Component\Translation\Loader\YamlFileLoader
xlf: Symfony\Component\Translation\Loader\XliffFileLoader
Expand Down
8 changes: 8 additions & 0 deletions src/Diagnostics/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ public function choiceError($e, $domain)
*/
public function addResource($format, $resource, $locale, $domain)
{
if (is_array($resource)) {
$resource = 'array ' . md5(serialize($resource));
}

$this->resources[$locale][$resource] = $domain;
}

Expand All @@ -260,6 +264,10 @@ public function setLocaleWhitelist($whitelist)
*/
public function addIgnoredResource($format, $resource, $locale, $domain)
{
if (is_array($resource)) {
$resource = 'array ' . md5(serialize($resource));
}

$this->ignoredResources[$locale][$resource] = $domain;
}

Expand Down

0 comments on commit 196e246

Please sign in to comment.