How to make all translations required for the given field?
Created 6 years ago by vargvinterHello,
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?
ryanthompson
—
6 years ago
@piterden nice one! @vargvinter let us know if that does the trick. This portion of the rules is generally automated but we'll sort it out 😊
vargvinter
—
6 years ago
I believe it should be
Or even