'symfony 5 form type define the labels

I created the CRUD for my entity and I need to somehow define the labels for the fields of the entity.

I can define them in the form type, for example:

$builder
    ->add('name' , null, [
        'attr' => ['autofocus' => true],
        'label' => 'Product name',
    ])

but I don't think this is the best solution.

Which is the best approach?

Do I have to use translations, even if the app is single language?

Is there any other solution?



Solution 1:[1]

Yes is this the best practies, in official documentation explained here https://symfony.com/doc/current/reference/forms/types/form.html#label-translation-parameters

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhamed RAFYQ