How to make all translations required for the given field?
vargvinter - 8 months ago
Example: I have three languages enabled in my site: English, German, Polish. English is default language. I have translatable text field in the form called "name". To submit this form I need to enter "name" value for english locale. But I want also german and polish locale to be required as well. So I put this code in FormBuilder class:
/** * Additional validation rules. * * @var array|string */ protected $rules = [ 'name_de' => [ 'required' ], 'name_pl' => [ 'required' ], ];
It works. Is it correct approach?
Next I want to have red asterix (star) for german and polish locale in the label (like for english locale) How to do that?