Laravel-Lang / publisher

Publisher provides functionality for working with application localization
https://laravel-lang.com/packages-publisher.html
MIT License
212 stars 25 forks source link

Publisher installs 'validation-inline' instead of 'validation' #214

Closed madman-81 closed 2 years ago

madman-81 commented 2 years ago

Description:

If you create a new project and install a language, the 'validation-inline' translations are used instead of 'validation'. Also, the original lang\en\validation.php is changed in this way.

I would have expected that either 'validation' is used or that both are installed separately.

If this is expected default behaviour, how can I choose to use 'validation' instead? Or how can I have them both installed separately?

Steps To Reproduce:

composer create-project laravel/laravel ./ composer require laravel-lang/publisher laravel-lang/lang --dev php artisan lang:add en nl de

andrey-helldar commented 2 years ago

Publish the configuration file and change the desired settings: https://laravel-lang.github.io/publisher/installation.html#laravel-framework

https://github.com/Laravel-Lang/publisher/blob/main/config/public.php#L34

andrey-helldar commented 2 years ago

Most often, in applications, the validation message is displayed immediately by the input field, so the publisher uses the inline version by default

madman-81 commented 2 years ago

It's nice that there is an option to change this, but I would not have expected it to change the default behaviour of Laravel. I would recommend to change the default value for inline to false and allow users to set it to true if they prefer the inline messages.

Also, there is no possibility to use that both at the same time now. If the publisher would generate two files, this is possible. The configuration option could have three values: 'normal' (default), 'inline' and 'both'. The first two would generate 1 validation.php file. The last one would generate two files.

andrey-helldar commented 2 years ago

As for the default value, I'll think about it.

As for saving two files, I think this is a bad idea, since the application only uses the validation.php file by default.

The validation-inline.php file is a feature of the laravel-lang/lang project, and the publisher skillfully chooses the right option.