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

why is laravel-lang/publisher required

Jimbolino opened this issue · comments

Feature description

Why is laravel-lang/publisher required now?
because laravel-lang/publisher depends on dragon-code/support, which requires ext-bcmath

why not keep this optional or require-dev ?

Environment

  • Laravel-Lang Version: latest
  • Laravel Version: latest
  • PHP Version: latest

Because the project has an original file structure and simply copying it into the project will not make it work. The publisher implements the possibility of publishing translations.

Yes, the publisher does indeed use the dragon-code/support package which has the bcmath dependency as it uses its functionality.

You can easily install this PHP extension by running sudo apt-get install php-bcmath

you could just symlink the relevant json files right?

thats how we used to do it in previous versions anyway :)

We can't do that because the structure of the files in the package doesn't match the structure of the files in the application.

Our files:

{locale}
  php.json
  php-inline.json
  json.json
  json-inline.json

Our files:

{locale}
  php.json
  php-inline.json
  json.json
  json-inline.json

Application files:

{locale}
  auth.php
  pagination.php
  passwords.php
  validation.php
{locale}.json

In addition, the files from the Lang project contain translations not only of the framework, but also of other Laravel packages. The files contain not just translations from different packages, but also from different versions of the same package.

When installing and updating translations, the publisher determines which of the packages are installed and adds keys to the project only for them.

So no, the symlink won't work.

And answering the very first question from the title, I’ll say that by adding the publisher to the mandatory installation, we thus standardized all our projects. In addition, at the moment there are no other installers for these files, as we are constantly improving the structure of the project and not everyone has time to update it, despite the fact that we release it only when the publisher is definitely working.

PS: I recommend using the laravel-lang/common project.

I assumed the main reason you switched from php to json was because the default laravel skeleton doesn't include the php file anymore (by default), and they added json support.

But now i've looked more closely at the package, and it does a lot more then what it did before :)
(i've been using this package since the Laravel 4.2 days)

Maybe a bit too late, but a changelog/upgrade guide would have been nice, at least for upgrading between the major versions :)

Thnx for the quick responses 👍

We've had a changelog on the site for a while, but it's mostly about which localizations have been translated. The same information is provided in the release notes on GitHub. We just duplicated it on the site.

As for the upgrade guide, it is quite simple: https://laravel-lang.com/installation/upgrade-guide/

I think we can expand this section of the site soon. The old version of the documentation is still available here: https://github.com/Laravel-Lang/publisher/blob/main/docs/installation/upgrade/index.md

Yeah, a lot has changed since early versions.
From 1.0 untill 8.0 the advice was to copy over the php files (because i'm lazy i just symlinked the directory 😃 )
In 9.0 and 10.0 this still worked

I guess you had the same problem as i did, but instead of a symlink you wrote a new package to automate the job hehe

Well, I never used symlinks unless they were referring to the storage folder 🙂

And so the Publisher project has existed for 5 years now. I started developing it when the Lang package was called caouecs/laravel-lang and had version 3 in release.