Skip to content

Commit

Permalink
Make salutation gender neutral (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-rath authored Dec 21, 2022
1 parent 4b52fdf commit 9cbb460
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 90 deletions.
6 changes: 4 additions & 2 deletions Dynamic/Types/SalutationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ public function getConfiguration(): FormFieldTypeConfiguration

public function build(FormBuilderInterface $builder, FormField $field, string $locale, array $options): void
{
$options['choice_translation_domain'] = 'messages';
$options['translation_domain'] = 'messages';
$options['expanded'] = false;
$options['multiple'] = false;
$options['choices'] = $this->getChoices();
$options['placeholder'] = 'sulu_form.salutation_please_choose';
$type = ChoiceType::class;
$builder->add($field->getKey(), $type, $options);
}
Expand All @@ -48,8 +49,9 @@ public function build(FormBuilderInterface $builder, FormField $field, string $l
protected function getChoices(): array
{
return [
'sulu_form.salutation_mr' => 'mr',
'sulu_form.salutation_ms' => 'ms',
'sulu_form.salutation_mr' => 'mr',
'sulu_form.salutation_neutral' => 'neutral',
];
}
}
4 changes: 3 additions & 1 deletion Resources/translations/admin.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@
"sulu_form.sendinblue_redirection_url": "Weiterleitungs-URL",
"sulu_form.sendinblue_attribute_name_first_name": "Attribut-Name [Vorname]",
"sulu_form.sendinblue_attribute_name_last_name": "Attribut-Name [Nachname]",
"sulu_form.salutation_mr": "Herr",
"sulu_form.salutation_ms": "Frau",
"sulu_form.salutation_mr": "Herr",
"sulu_form.salutation_neutral": "Neutral",
"sulu_form.salutation_please_choose": "Bitte auswählen",
"sulu_form.single_form_selection.no_form_selected": "Kein Formular ausgewählt",
"sulu_form.single_form_selection.overlay_title": "Wählen Sie ein Formular aus",
"sulu_activity.resource.forms": "Formular",
Expand Down
4 changes: 3 additions & 1 deletion Resources/translations/admin.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@
"sulu_form.sendinblue_redirection_url": "Redirection url",
"sulu_form.sendinblue_attribute_name_first_name": "Attribute name [First name]",
"sulu_form.sendinblue_attribute_name_last_name": "Attribute name [Last name]",
"sulu_form.salutation_mr": "Mr.",
"sulu_form.salutation_ms": "Ms.",
"sulu_form.salutation_mr": "Mr.",
"sulu_form.salutation_neutral": "Neutral",
"sulu_form.salutation_please_choose": "Please choose",
"sulu_form.single_form_selection.no_form_selected": "No form selected",
"sulu_form.single_form_selection.overlay_title": "Select a form",
"sulu_activity.resource.forms": "Form",
Expand Down
10 changes: 9 additions & 1 deletion Resources/translations/messages.de.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
<source>sulu_form.mail.plain_text</source>
<target>Diese Mail kann nur in HTML angezeigt werden</target>
</trans-unit>
<trans-unit id="5">
<source>sulu_form.salutation_neutral</source>
<target>Neutral</target>
</trans-unit>
<trans-unit id="6">
<source>sulu_form.salutation_please_choose</source>
<target>Bitte auswählen</target>
</trans-unit>
</body>
</file>
</xliff>
</xliff>
10 changes: 9 additions & 1 deletion Resources/translations/messages.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
<source>sulu_form.mail.plain_text</source>
<target>This mail can only be viewed in HTML</target>
</trans-unit>
<trans-unit id="5">
<source>sulu_form.salutation_neutral</source>
<target>Neutral</target>
</trans-unit>
<trans-unit id="6">
<source>sulu_form.salutation_please_choose</source>
<target>Please choose</target>
</trans-unit>
</body>
</file>
</xliff>
</xliff>
10 changes: 9 additions & 1 deletion Resources/translations/messages.fr.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
<source>sulu_form.mail.plain_text</source>
<target>Ce courrier ne peut être visualisé qu'en HTML</target>
</trans-unit>
<trans-unit id="5">
<source>sulu_form.salutation_neutral</source>
<target>Neutre</target>
</trans-unit>
<trans-unit id="6">
<source>sulu_form.salutation_please_choose</source>
<target>Veuillez choisir</target>
</trans-unit>
</body>
</file>
</xliff>
</xliff>
10 changes: 9 additions & 1 deletion Resources/translations/messages.nl.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
<source>sulu_form.mail.plain_text</source>
<target>Deze mail is alleen in HTML te bekijken</target>
</trans-unit>
<trans-unit id="5">
<source>sulu_form.salutation_neutral</source>
<target>Neutrale</target>
</trans-unit>
<trans-unit id="6">
<source>sulu_form.salutation_please_choose</source>
<target>Gelieve te kiezen</target>
</trans-unit>
</body>
</file>
</xliff>
</xliff>
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"jackalope/jackalope-doctrine-dbal": "^1.3.2",
"jangregor/phpstan-prophecy": "^1.0",
"massive/search-bundle": "^2.0",
"phpspec/prophecy": "^1.14",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand Down
84 changes: 2 additions & 82 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ parameters:
count: 1
path: Admin/DynamicListAdmin.php

-
message: "#^Parameter \\#1 \\$tabOrder of method Sulu\\\\Bundle\\\\AdminBundle\\\\Admin\\\\View\\\\ListViewBuilderInterface\\:\\:setTabOrder\\(\\) expects int, mixed given\\.$#"
count: 1
path: Admin/DynamicListAdmin.php

-
message: "#^Parameter \\#1 \\$viewName of method Sulu\\\\Bundle\\\\AdminBundle\\\\Admin\\\\View\\\\ViewCollection\\:\\:has\\(\\) expects string, mixed given\\.$#"
count: 1
path: Admin/DynamicListAdmin.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 2
count: 1
path: Admin/DynamicListAdmin.php

-
Expand Down Expand Up @@ -410,11 +405,6 @@ parameters:
count: 1
path: Dynamic/Checksum.php

-
message: "#^Cannot access offset 'lists' on array\\|false\\.$#"
count: 1
path: Dynamic/Helper/MailchimpListSelect.php

-
message: "#^Property Sulu\\\\Bundle\\\\FormBundle\\\\Dynamic\\\\Helper\\\\MailchimpListSelect\\:\\:\\$apiKey \\(string\\) does not accept string\\|null\\.$#"
count: 1
Expand Down Expand Up @@ -445,21 +435,6 @@ parameters:
count: 1
path: Dynamic/Helper/SendinblueMailTemplateSelect.php

-
message: "#^Cannot access an offset on mixed\\.$#"
count: 2
path: Dynamic/Types/AttachmentType.php

-
message: "#^Cannot access offset 'accept' on mixed\\.$#"
count: 1
path: Dynamic/Types/AttachmentType.php

-
message: "#^Cannot access offset 'max' on mixed\\.$#"
count: 1
path: Dynamic/Types/AttachmentType.php

-
message: "#^Cannot call method getDefaultValue\\(\\) on Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\FormFieldTranslation\\|null\\.$#"
count: 1
Expand Down Expand Up @@ -640,11 +615,6 @@ parameters:
count: 1
path: Dynamic/Types/FirstNameType.php

-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 1
path: Dynamic/Types/FreeTextType.php

-
message: "#^Cannot call method getDefaultValue\\(\\) on Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\FormFieldTranslation\\|null\\.$#"
count: 1
Expand All @@ -655,11 +625,6 @@ parameters:
count: 1
path: Dynamic/Types/FunctionType.php

-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 1
path: Dynamic/Types/HeadlineType.php

-
message: "#^Cannot call method getDefaultValue\\(\\) on Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\FormFieldTranslation\\|null\\.$#"
count: 1
Expand Down Expand Up @@ -715,11 +680,6 @@ parameters:
count: 1
path: Dynamic/Types/RadioButtonsType.php

-
message: "#^Cannot access offset 'options' on mixed\\.$#"
count: 1
path: Dynamic/Types/RecaptchaType.php

-
message: "#^Cannot call method getDefaultValue\\(\\) on Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\FormFieldTranslation\\|null\\.$#"
count: 1
Expand All @@ -735,11 +695,6 @@ parameters:
count: 1
path: Dynamic/Types/SendinblueType.php

-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 1
path: Dynamic/Types/SpacerType.php

-
message: "#^Cannot call method getDefaultValue\\(\\) on Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\FormFieldTranslation\\|null\\.$#"
count: 1
Expand Down Expand Up @@ -1102,7 +1057,7 @@ parameters:

-
message: "#^Cannot access offset 'type' on array\\|bool\\|float\\|int\\|string\\.$#"
count: 2
count: 1
path: Form/Builder.php

-
Expand Down Expand Up @@ -1130,11 +1085,6 @@ parameters:
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#1 \\$id of method Sulu\\\\Bundle\\\\FormBundle\\\\Form\\\\Builder\\:\\:build\\(\\) expects int, mixed given\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#2 \\$type of method Sulu\\\\Bundle\\\\FormBundle\\\\Dynamic\\\\Checksum\\:\\:check\\(\\) expects string, mixed given\\.$#"
count: 1
Expand All @@ -1150,31 +1100,16 @@ parameters:
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#3 \\$typeId of method Sulu\\\\Bundle\\\\FormBundle\\\\Form\\\\Builder\\:\\:build\\(\\) expects string, mixed given\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#4 \\$formId of method Sulu\\\\Bundle\\\\FormBundle\\\\Dynamic\\\\Checksum\\:\\:check\\(\\) expects int, mixed given\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#4 \\$locale of method Sulu\\\\Bundle\\\\FormBundle\\\\Form\\\\Builder\\:\\:build\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#5 \\$formName of method Sulu\\\\Bundle\\\\FormBundle\\\\Dynamic\\\\Checksum\\:\\:check\\(\\) expects string, mixed given\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#5 \\$name of method Sulu\\\\Bundle\\\\FormBundle\\\\Form\\\\Builder\\:\\:build\\(\\) expects string, mixed given\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#6 \\$webspaceKey of method Sulu\\\\Bundle\\\\FormBundle\\\\Form\\\\Builder\\:\\:createForm\\(\\) expects string, string\\|null given\\.$#"
count: 1
Expand Down Expand Up @@ -1750,21 +1685,6 @@ parameters:
count: 1
path: Repository/DynamicRepository.php

-
message: "#^Parameter \\#2 \\$search of method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\DynamicRepository\\:\\:addSearchFilter\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: Repository/DynamicRepository.php

-
message: "#^Parameter \\#3 \\$searchFields of method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\DynamicRepository\\:\\:addSearchFilter\\(\\) expects array\\<string\\>\\|null, mixed given\\.$#"
count: 1
path: Repository/DynamicRepository.php

-
message: "#^Parameter \\#3 \\$toDate of method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\DynamicRepository\\:\\:addDateRangeFilter\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: Repository/DynamicRepository.php

-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
Expand Down

0 comments on commit 9cbb460

Please sign in to comment.