Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit a88ba68

Browse files
committed
translating menu option extension descriptions to fr and de, adding help and sanity check
1 parent e128da1 commit a88ba68

File tree

5 files changed

+105
-12
lines changed

5 files changed

+105
-12
lines changed

Admin/Extension/MenuOptionsExtension.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MenuOptionsExtension extends AdminExtension
3434

3535
/**
3636
* @param string $formGroup - group to use for form mapper
37-
* @param bool $advanced - activates editing all fields of the node
37+
* @param bool $advanced - activates editing all fields of the node
3838
*/
3939
public function __construct($formGroup = 'form.group_menu_options', $advanced = false)
4040
{
@@ -53,12 +53,14 @@ public function configureFormFields(FormMapper $formMapper)
5353
->add(
5454
'display',
5555
'checkbox',
56-
array('required' => false)
56+
array('required' => false),
57+
array('help' => 'form.help_display')
5758
)
5859
->add(
5960
'displayChildren',
6061
'checkbox',
61-
array('required' => false)
62+
array('required' => false),
63+
array('help' => 'form.help_display_children')
6264
)
6365
->end();
6466

@@ -81,7 +83,7 @@ public function configureFormFields(FormMapper $formMapper)
8183
array(
8284
'value_type' => 'text',
8385
'required' => false,
84-
'options' => $child_options
86+
'options' => $child_options,
8587
)
8688
)
8789
->add(
@@ -90,7 +92,7 @@ public function configureFormFields(FormMapper $formMapper)
9092
array(
9193
'value_type' => 'text',
9294
'required' => false,
93-
'options' => $child_options
95+
'options' => $child_options,
9496
)
9597
)
9698
->add(
@@ -99,7 +101,7 @@ public function configureFormFields(FormMapper $formMapper)
99101
array(
100102
'value_type' => 'text',
101103
'required' => false,
102-
'options' => $child_options
104+
'options' => $child_options,
103105
)
104106
)
105107
->add(
@@ -108,7 +110,7 @@ public function configureFormFields(FormMapper $formMapper)
108110
array(
109111
'value_type' => 'text',
110112
'required' => false,
111-
'options' => $child_options
113+
'options' => $child_options,
112114
)
113115
)
114116
->end();

Model/MenuNodeBase.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,17 @@ public function setRouteAbsolute($routeAbsolute)
559559
return $this;
560560
}
561561

562+
/**
563+
* Whether this menu node can be displayed, meaning it is set to display
564+
* and it does have a non-empty label.
565+
*
566+
* @return boolean
567+
*/
568+
public function isDisplayable()
569+
{
570+
return $this->getDisplay() && $this->getLabel();
571+
}
572+
562573
/**
563574
* {@inheritDoc}
564575
*/
@@ -570,12 +581,12 @@ public function getOptions()
570581
'label' => $this->getLabel(),
571582
'attributes' => $this->getAttributes(),
572583
'childrenAttributes' => $this->getChildrenAttributes(),
573-
'display' => $this->display,
574-
'displayChildren' => $this->displayChildren,
584+
'display' => $this->isDisplayable(),
585+
'displayChildren' => $this->getDisplayChildren(),
575586
'routeParameters' => $this->getRouteParameters(),
576-
'routeAbsolute' => $this->routeAbsolute,
577-
'linkAttributes' => $this->linkAttributes,
578-
'labelAttributes' => $this->labelAttributes,
587+
'routeAbsolute' => $this->getRouteAbsolute(),
588+
'linkAttributes' => $this->getLinkAttributes(),
589+
'labelAttributes' => $this->getLabelAttributes(),
579590
);
580591
}
581592
}

Resources/translations/CmfMenuBundle.de.xliff

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,42 @@
118118
<source>form.label_menu_nodes</source>
119119
<target>Menü</target>
120120
</trans-unit>
121+
<trans-unit id="form.group_menu_options">
122+
<source>form.group_menu_options</source>
123+
<target>Menü-Optionen</target>
124+
</trans-unit>
125+
<trans-unit id="form.label_display">
126+
<source>form.label_display</source>
127+
<target>Anzeigen</target>
128+
</trans-unit>
129+
<trans-unit id="form.help_display">
130+
<source>form.help_display</source>
131+
<target>Ein Menüeintrag wird nur angezeigt wenn die Beschriftung nicht leer ist.</target>
132+
</trans-unit>
133+
<trans-unit id="form.label_display_children">
134+
<source>form.label_display_children</source>
135+
<target>Unterelemente anzeigen</target>
136+
</trans-unit>
137+
<trans-unit id="form.help_display_children">
138+
<source>form.help_display_children</source>
139+
<target>Unterelemente werden nur angezeigt, wenn der Menüeintrag selber angezeigt wird.</target>
140+
</trans-unit>
141+
<trans-unit id="form.label_attributes">
142+
<source>form.label_attributes</source>
143+
<target>Menü-Attribute</target>
144+
</trans-unit>
145+
<trans-unit id="form.label_label_attributes">
146+
<source>form.label_label_attributes</source>
147+
<target>Beschriftungs-Attribute</target>
148+
</trans-unit>
149+
<trans-unit id="form.label_children_attributes">
150+
<source>form.label_children_attributes</source>
151+
<target>Attribute für Unterelemente</target>
152+
</trans-unit>
153+
<trans-unit id="form.label_link_attributes">
154+
<source>form.label_link_attributes</source>
155+
<target>Link-Attribute</target>
156+
</trans-unit>
121157
</body>
122158
</file>
123159
</xliff>

Resources/translations/CmfMenuBundle.en.xliff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,18 @@
134134
<source>form.label_display</source>
135135
<target>Display</target>
136136
</trans-unit>
137+
<trans-unit id="form.help_display">
138+
<source>form.help_display</source>
139+
<target>A menu entry is only displayed if the label is not empty.</target>
140+
</trans-unit>
137141
<trans-unit id="form.label_display_children">
138142
<source>form.label_display_children</source>
139143
<target>Display Children</target>
140144
</trans-unit>
145+
<trans-unit id="form.help_display_children">
146+
<source>form.help_display_children</source>
147+
<target>Children are only displayed if the menu entry itself is displayed.</target>
148+
</trans-unit>
141149
<trans-unit id="form.label_attributes">
142150
<source>form.label_attributes</source>
143151
<target>Menu attributes</target>

Resources/translations/CmfMenuBundle.fr.xliff

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,42 @@
126126
<source>form.label_menu_nodes</source>
127127
<target>Menu</target>
128128
</trans-unit>
129+
<trans-unit id="form.group_menu_options">
130+
<source>form.group_menu_options</source>
131+
<target>Options Menu</target>
132+
</trans-unit>
133+
<trans-unit id="form.label_display">
134+
<source>form.label_display</source>
135+
<target>Visible</target>
136+
</trans-unit>
137+
<trans-unit id="form.help_display">
138+
<source>form.help_display</source>
139+
<target>Un élément menu est visible seulement si le nom est remplit.</target>
140+
</trans-unit>
141+
<trans-unit id="form.label_display_children">
142+
<source>form.label_display_children</source>
143+
<target>Montrer les éléments subordonné</target>
144+
</trans-unit>
145+
<trans-unit id="form.help_display_children">
146+
<source>form.help_display_children</source>
147+
<target>Les éléments subordonné sont visible seulement si l'élément menu lui-même est visible.</target>
148+
</trans-unit>
149+
<trans-unit id="form.label_attributes">
150+
<source>form.label_attributes</source>
151+
<target>Attributs Menu</target>
152+
</trans-unit>
153+
<trans-unit id="form.label_label_attributes">
154+
<source>form.label_label_attributes</source>
155+
<target>Attributs Nom</target>
156+
</trans-unit>
157+
<trans-unit id="form.label_children_attributes">
158+
<source>form.label_children_attributes</source>
159+
<target>Attributs éléments subordonnés</target>
160+
</trans-unit>
161+
<trans-unit id="form.label_link_attributes">
162+
<source>form.label_link_attributes</source>
163+
<target>Attributs Lien</target>
164+
</trans-unit>
129165
</body>
130166
</file>
131167
</xliff>

0 commit comments

Comments
 (0)