Skip to content

Commit 5022ba6

Browse files
committed
Made translatable the value of the string list field content
1 parent 904b87c commit 5022ba6

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ To get the diff for a specific change, go to https://github.com/LIN3S/AdminBundl
66
To get the diff between two versions, go to https://github.com/LIN3S/AdminBundle/compare/v0.4.0...v0.5.0
77

88
* 0.6.0
9+
* Made translatable the value of the string list field content.
910
* Moved the `javascripts` Twig block from top to bottom in the body.
1011
* Extracted panel independent Twig component.
1112
* Improved button component adding type parameter.

src/LIN3S/AdminBundle/Extension/ListField/StringListFieldType.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use Symfony\Component\Translation\TranslatorInterface;
1717

1818
/**
19-
* String list field type.
20-
*
2119
* @author Gorka Laucirica <gorka.lauzirika@gmail.com>
2220
*/
2321
final class StringListFieldType implements ListFieldType
@@ -38,9 +36,6 @@ public function header($name, Entity $configuration)
3836
return $this->translator->trans($name);
3937
}
4038

41-
/**
42-
* {@inheritdoc}
43-
*/
4439
public function render($entity, $options, Entity $configuration)
4540
{
4641
if (!isset($options['field'])) {
@@ -53,6 +48,6 @@ public function render($entity, $options, Entity $configuration)
5348
$value = $value->$property();
5449
}
5550

56-
return $value;
51+
return $this->translator->trans($value);
5752
}
5853
}

0 commit comments

Comments
 (0)