Skip to content

Commit 9948cf0

Browse files
committed
Merge pull request #140 from symfony-cmf/translation-cleanup
cleanup translation handling
2 parents a828d3d + 04643a2 commit 9948cf0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Admin/Extension/PublishableExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function configureFormFields(FormMapper $formMapper)
4545
))
4646
->add('publishable', 'checkbox', array(
4747
'required' => false,
48-
), array(
4948
))
5049
->end();
5150
}

Admin/Extension/TranslatableExtension.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public function __construct($locales, $formGroup = 'form.group_general')
5050
public function configureListFields(ListMapper $listMapper)
5151
{
5252
$listMapper
53-
->add('locales', 'choice', array('template' => 'SonataDoctrinePHPCRAdminBundle:CRUD:locales.html.twig'))
53+
->add('locales', 'choice', array(
54+
'template' => 'SonataDoctrinePHPCRAdminBundle:CRUD:locales.html.twig',
55+
'translation_domain' => 'CmfCoreBundle',
56+
))
5457
;
5558
}
5659

@@ -61,11 +64,11 @@ public function configureFormFields(FormMapper $formMapper)
6164
{
6265
$formMapper
6366
->with($this->formGroup)
67+
// do not set a translation_domain for this group or group_general will be translated by our domain.
6468
->add('locale', 'choice', array(
65-
'translation_domain' => 'CmfCoreBundle',
6669
'choices' => array_combine($this->locales, $this->locales),
6770
'empty_value' => '',
68-
))
71+
), array('translation_domain' => 'CmfCoreBundle'))
6972
->end()
7073
;
7174
}

0 commit comments

Comments
 (0)