Laravel-Lang / lang

List of 126 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova, Laravel Spark and Laravel UI.

Home Page:https://laravel-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update Style CI whitespace check

lasseeee opened this issue · comments

commented

The way this repo is set up to add white space in arrays through Style CI is outdated and should be updated to match how the Laravel repo now does it. There are legitimate reasons not to add the white space, even though it seems to make readability worse.

We prefer with spaces ;)

commented

I understand.

It's not in line with the official files though: https://github.com/laravel/laravel/blob/master/resources/lang/en/validation.php and whenever a new translation key is added that is longer than any of the previous keys, white space would need to be added to all the keys, effectively making it impossible to see which key was the new one, as the current setup of Style CI would probably most if not all the lines in the affected file. This is why this kind of extra white space styling was abandoned.

We are not an official package of Laravel ;)

So I prefer more reactions of community before change something

commented

I'd be surprised if the community would oppose this, as it would align this package (which is made for Laravel) better with Laravel.

@lasseeee, in one of the translation managers it is possible to choose the appearance of the final file.

When this option is set to true, the resulting file will be nicely formatted with space characters.
When this option is set to false, the resulting file will not use spaces.

See https://github.com/andrey-helldar/laravel-lang-publisher/blob/master/config/lang-publisher.php#L21-L27

Using this package you can independently control the appearance of the final files and not worry about updating them. The package itself will do as you like 👍

commented

Amazing!

Personally, my opinion is that a formatted array is much easier to read and modify. Therefore, we here prefer to store it in this form. It makes us happy.

You can also use the translation manager, which can save the final file in two versions - with and without formatting.

In my opinion, this is ideal for fans of one of two formats.