laravel / ideas

Issues board used for Laravel internals discussions.
940 stars 28 forks source link

Official translation repository #1201

Open markwalet opened 6 years ago

markwalet commented 6 years ago

Based on the following pull-request I saw this morning: https://github.com/laravel/laravel/pull/4673

I am not a fan of just adding all language packs to the default installation. This just gives too much files that hardly anyone would use anyway. I'd like an approach similar to the php artisan make:auth command. Which is only installing something when you need it.

My idea is to create a new repository laravel/localization where translation files for all languages will be stored. Maybe we can collaborate with existing repositories like https://github.com/caouecs/Laravel-lang (I don't know if there are better alternatives. Just found this one with a quick search on Google)

I have to main reasons for creating an official language pack repository:

  1. This gives more control in keeping the language packs up-to-date with new Laravel releases.
  2. I want to add some commands for helping with managing the different languages.

Some ideas:

I am reasonable experienced with Laravel and package development so I'm confident that I can help out with implementing this feature. I'd love to contribute, especially if it is on one of my own ideas.

I don't know completely sure if this is already proposed and rejected a little while ago. I did a search in the issue list and couldn't find anything. I'd love some feedback on this idea. Maybe you guys also have some interesting things that could improve this feature request.

fletch3555 commented 6 years ago

This would probably best be built into a package and eventually incorporated into the core.

markwalet commented 6 years ago

We could do that. But I'd like to keep them in the official laravel namespace. That makes it easier to maintain.

For accepting translation updates we could use the thumbs up/down reactions on pull requests for example. With enough positive reactions the pull-request can be safely accepted. It shouldn't be designed to be perfect. But nearly perfect. Just like the English translations.

I want to have the same approach as the make:auth command. Making extra languages optional but easy to install with a single command that you can remember. An extra compose require would ruin that experience.

stephan-v commented 6 years ago

An extra compose require would ruin that experience.

This is but a small step really. I would be fine with having another repository with "official" translations but never should this be part of the core in which translations come by default.

You have to think about the bigger picture here. You want to add this to artisan by default but there are probably a dozen others who want to add default commands as well and you end up with a list of 150 artisan commands.

Besides that you also do not want to blow up the size of the initial installation with even more files that might not get used anyways by the majority of users.

markwalet commented 6 years ago

Agreed, we have to prevent that the list of artisan commands doesn't get too big. The downside of this solution is that is adds 3 extra commands.

Regarding the potentially unused files, an installation command prevents that from happening.

An administrator should make a decision here. I really want to have these translations in a official namespace and environment. It could be in a seperate package, or with install commands in the main installation.

Kyslik commented 6 years ago

While we are at it, validation should also support pluralization

As its stated in the doc itself:

Pluralization is a complex problem, as different languages have a variety of complex rules for pluralization.

Most of validation rules without it look silly in slavic languages.


Regarding artisan commands it should be configurable which to show.

markwalet commented 5 years ago

Any updates?

markwalet commented 4 years ago

Following the new laravel/ui package, we could consider developing a new package for this under the laravel/localization or laravel/lang namespace. Thoughts?