diff --git a/src/Form/Settings/TypeSynonymRowType.php b/src/Form/Settings/TypeSynonymRowType.php index 234a7691..f3b8f0b6 100644 --- a/src/Form/Settings/TypeSynonymRowType.php +++ b/src/Form/Settings/TypeSynonymRowType.php @@ -31,6 +31,7 @@ use Symfony\Component\Form\Extension\Core\Type\LocaleType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Intl\Locales; +use Symfony\Component\Translation\StaticMessage; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Contracts\Translation\TranslatorInterface; @@ -67,7 +68,9 @@ class TypeSynonymRowType extends AbstractType new Assert\NotBlank(), ], 'choice_label' => function (ElementTypes $choice) { - return $this->translator->trans($choice->getDefaultLabelKey()) . ' (' . $this->translator->trans($choice->getDefaultPluralLabelKey()) . ')'; + return new StaticMessage( + $this->translator->trans($choice->getDefaultLabelKey()) . ' (' . $this->translator->trans($choice->getDefaultPluralLabelKey()) . ')' + ); }, 'row_attr' => ['class' => 'mb-0'], 'attr' => ['class' => 'form-select-sm'], diff --git a/src/Settings/MiscSettings/IpnSuggestSettings.php b/src/Settings/MiscSettings/IpnSuggestSettings.php index 891b885c..6094b035 100644 --- a/src/Settings/MiscSettings/IpnSuggestSettings.php +++ b/src/Settings/MiscSettings/IpnSuggestSettings.php @@ -30,6 +30,7 @@ use Jbtronics\SettingsBundle\ParameterTypes\StringType; use Jbtronics\SettingsBundle\Settings\Settings; use Jbtronics\SettingsBundle\Settings\SettingsParameter; use Jbtronics\SettingsBundle\Settings\SettingsTrait; +use Symfony\Component\Translation\StaticMessage; use Symfony\Component\Translation\TranslatableMessage as TM; use Symfony\Component\Validator\Constraints as Assert; @@ -43,7 +44,7 @@ class IpnSuggestSettings label: new TM("settings.misc.ipn_suggest.regex"), description: new TM("settings.misc.ipn_suggest.regex.help"), options: ['type' => StringType::class], - formOptions: ['attr' => ['placeholder' => '^[A-Za-z0-9]{3,4}(?:-[A-Za-z0-9]{3,4})*-\d{4}$']], + formOptions: ['attr' => ['placeholder' => new StaticMessage( '^[A-Za-z0-9]{3,4}(?:-[A-Za-z0-9]{3,4})*-\d{4}$')]], envVar: "IPN_SUGGEST_REGEX", envVarMode: EnvVarMode::OVERWRITE, )] public ?string $regex = null;