Git Product home page Git Product logo

publisher's Issues

Is the facade meant for use in code or for CI/CD?

  • Lang Publisher Version: ^14.0
  • Laravel Version: latest
  • PHP Version: 8.1.7

Question:
When I use the facade in my middleware to set request based locales, I am forced to pull all three packages in production i.s.o. dev in my composer.json.

Is this how it should be, or am I not using the facade as designed?

Implement the ability to reset default translation files

For example, when using command php artisan lang:reset, you need to reset the translation files to the default state.

The implementation of two methods is planned:

  1. php artisan lang:reset --full - full reset to default values;
  2. php artisan lang:reset - saving excluded keys specified in the configuration.

json translations for `laravel/framework` are not published

  • Lang Publisher Version: 10.2.0
  • Laravel Version: 8.63.0
  • PHP Version: 8.0.11

Description:

json translations for laravel/framework are not published, only json translations of packages are published

Steps To Reproduce:

Delete json translations files from resources/lang and run php artisan lang:update

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

  • Lang Publisher Version: 12.1
  • Laravel Version: 8.80
  • PHP Version: 7.4

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

Add the ability to copy json keys

In addition to copying php files of locales, you also need to copy json files while maintaining the functionality of prohibiting changes to some keys.

Overloaded translation

Environment

  • Laravel-Lang Publisher Version: 14.6.4
  • Laravel Version: 10.9.0
  • PHP Version: 8.2

Issue description

Hello,

I'm experiencing strange behavior with my forxer/generic-term-translations-for-laravel plugin for Laravel Lang

I have a file /source/misc.php in which there is an array key named "required"' Link

When I update the language files, I find /lang/{language}/misc.php with the good translation.

So far, so good

But when I call the translation {{ trans('misc.required') }} this is replaced by that of the validation.php file.

I was expecting to get what's in the plugin's misc.php file but I got what's in the validation.php file instead.

Steps to reproduce

Install forxer/generic-term-translations-for-laravel

Display in a view {{ trans('misc.required') }}

Expected string:

  • "required" in en
  • "requis" in fr

Result string:

  • "The :attribute field is required." in en
  • "Le champ :attribute est obligatoire." in fr

How to install a localization from laravel-lang/lang ?

  • Lang Publisher Version: 11.1.5
  • Laravel Version: 8.79.0
  • PHP Version: 7.4

Description:

How to install italian locale?

I have installed both

    "laravel-lang/lang": "~8.0",
    "laravel-lang/publisher": "^11.1",

I want to simply install/expose/use italian localizations

I am not able to do understand how to do

Steps To Reproduce:

I also tried a locale:add it but it creates new empty file for italian locales

I tried also running locale:update but nothing changes

Attribute name translation not working

Translation does not work after updating to the latest version and updating transtaions using php artisan lang:update.

Here is a example:
image

After updating transtations the validation.php file looks like:

<?php

return [
    'attributes' => [
        'frontend.email' => 'E-mail',
        'frontend.password' => 'Password',
        //...
    ]
];

Originally posted by @icaliman in #289 (comment)

[V11] Remove keys and empty files

  • Lang Publisher Version: 11.1.6
  • Laravel Version: 8.74
  • PHP Version: 8.0

Description:

I'm using Arabic locale. After upgrading to v11.1.6 from v10:

  • When run php artisan lang:update the following keys deleted from the validation file (accepted_if, declined, declined_if, prohibits). Also, the attributes array became empty.

  • When adding any locale, e.g. fr, the package publishes the files with an empty array as content.

Problem Installing package for L5.7

I don't quite understant what I am doing wrong.
Laravel Framework 5.7.28

vagrant@homestead:~/code/ce$ composer require andrey-helldar/laravel-lang-publisher --dev
Using version ^1.2 for andrey-helldar/laravel-lang-publisher
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for andrey-helldar/laravel-lang-publisher ^1.2 -> satisfiable by andrey-helldar/laravel-lang
-publisher[v1.2.0, v1.2.1].
    - Can only install one of: caouecs/laravel-lang[dev-laravel58, 3.0.62].
    - Can only install one of: caouecs/laravel-lang[dev-laravel58, 3.0.62].
    - Can only install one of: caouecs/laravel-lang[dev-laravel58, 3.0.62].
    - Conclusion: install caouecs/laravel-lang dev-laravel58
    - Installation request for caouecs/laravel-lang (locked at 3.0.62, required as ~3.0) -> satisfiable by caouecs/laravel-lang[3.0.62].

Wrong upper and lowercases in replaced attributes

Environment

  • Laravel-Lang Version: 3.1.1
  • Laravel Version: 10.2.0
  • PHP Version: 8.2

Issue description

Email-Validation with a wrong email leads to the following error message in German:
"E-mail-adresse muss eine gültige E-Mail-Adresse sein."
As visible the first automatically replaced "E-mail-adresse" has the wrong casing - should be written like the latter "E-Mail-Adresse" with upper cases.

In older versions of laravel-lang the attributes have been replaced with ":attribute" and correct casing in the validation.php attribute list 'email' => 'E-Mail-Adresse'. In the current version it is done with ":Attribute" and 'email' => 'e-mail-adresse', what finally results in the capital first letter (which I guess is a laravel feature thats not documented?!)

The question is now: is it a Bug in laravel-lang, or in laravels localization feature? For all other attributes this migth be ok, but I guess there are more cases where a dash is used!?

Since the official laravel installation doesn't use :attribute I'd prefer the old solution...

Steps to reproduce

just validate with german translation file

All commands fail - TypeError Processors/Processor.php

  • Lang Publisher Version: 14.0.1
  • Lang Lang Version: 11.0.1
  • Laravel Version: 9.19.0
  • PHP Version: 8.1.3

Description:

  TypeError

  LaravelLang\Publisher\Processors\Processor::LaravelLang\Publisher\Processors\{closure}(): Argument #1 ($plugin) must be of type string, array given, called in .../vendor/dragon-code/support/src/Instances/Call.php on line 163

  at vendor/laravel-lang/publisher/src/Processors/Processor.php:123
    119▕     {
    120▕         return Arr::of($this->config->plugins())
    121▕             ->map(static function (array $plugins): array {
    122▕                 return Arr::of($plugins)
  ➜ 123▕                     ->map(static fn (string $plugin)    => new $plugin())
    124▕                     ->filter(static fn (Plugin $plugin) => $plugin->has())
    125▕                     ->toArray();
    126▕             })
    127▕             ->filter()

Steps To Reproduce:

  1. Install the package
  2. Run any command.

Italian language installation and update fails when Pest is installed

  • Lang Publisher Version: 14.3.0
  • Laravel Version: 9.27.0
  • PHP Version: 8.1.2

Description:

Recently I installed Laravel Lang with Publisher and added the Italian language using the command php artisan lang:add it and worked like a charm, after installing it I've edited my composer.json to run this language on post-root-package-install script and php artisan lang:update on post-update-cmd script.

Today I needed to install Pest, after the package installation, the update failed when reaching the Italian language with this error:


   INFO  LaravelLang\Attributes\Plugin.  

  Collect source .......................................................................................................................... 4ms DONE
  Collecting en ........................................................................................................................... 2ms DONE

   ArgumentCountError 

  Too few arguments to function it(), 0 passed in D:\git\sms-crm\vendor\dragon-code\support\src\Instances\Call.php on line 181 and at least 1 expected

  at D:\git\sms-crm\vendor\pestphp\pest\src\Functions.php:110
    106▕      * a closure that contains the test expectations.
    107▕      *
    108▕      * @return TestCall|TestCase|mixed
    109▕      */
  ➜ 110▕     function it(string $description, Closure $closure = null): TestCall
    111▕     {
    112▕         $description = sprintf('it %s', $description);
    113▕
    114▕         return test($description, $closure);

  1   D:\git\sms-crm\vendor\dragon-code\support\src\Instances\Call.php:181
      it()

  2   D:\git\sms-crm\vendor\dragon-code\support\src\Facades\Facade.php:29
      DragonCode\Support\Instances\Call::value("it")

This error is thrown every time the command php artisan lang:update is executed.

Steps To Reproduce:

  1. Install Laravel Lang as dev dependency;
  2. Install Laravel Lang Publisher as dev dependency
  3. Add Italian language with php artisan lang:add it;
  4. Install Pest as dev dependecy;
  5. Run php artisan lang:update.

Publisher doesn't detect Jetstream Translations in Laravel 10

Environment

  • Laravel-Lang Publisher Version: 14.6.1
  • Laravel Version: 10.0.0
  • PHP Version: 8.2.2

Issue description

@andrey-helldar In Laravel 9 it was detected if jetstream was installed and the translations were added, in Laravel 10 only the framework translations are added, that is, it is not working

image

There may also be bugs with breeze or other packages

Steps to reproduce

  • laravel new project --jet
  • Choose livewire stack (also i choose phpunit)
  • Set language:
    • Change config.app.locale to es
    • Run composer require laravel-lang/publisher laravel-lang/lang laravel-lang/attributes --dev
    • Run php artisan lang:add es

Result
Spanish translations for Jetstream Views weren't added.

Make lang path configurable

It would be nice, if the publishing path could be adjusted / configured.

Use-case: Laravel 9 now defaults to "/lang" instead of "/resources/lang" and it would be nice to have the language files in one place. Otherwise i have to remove the "/lang" folder on a fresh install, because laravel will select "/resources/lang".

Thank you!

Translation was override if has same key

  • Lang Publisher Version: 14.3
  • Laravel Version: 9.24.0
  • PHP Version: 8.1.6

Description:

It's quite common that there are same key inside different files.
Inside the json.josn#L444 has a key with password, which will be written to auth.php used for the label for password input box.
At the same time, in php.json#L82 also has a key named password. It is used for showing error when password is incorrect.

When the locale was generated, the one in the php.json is reserved (or it replaced the value which generated from json.json). It causes to show wrong string at password input box.

Steps To Reproduce:

php artisan lang:add {any language}

Unable to add or update languages

  • Lang Publisher Version: 11.1.4
  • Lang Lang Version: 10.1.11
  • Laravel Version: 8.74.0
  • PHP Version: 8.1.0

Description:

Upon trying to add a language, the following legend shows: "Could not find plugins available for processing". The same occurs when using lang:update(I had the assets from a previous version).

Steps To Reproduce:

  1. Attempt to install a language or update a previous one

Missing translation keys from Notifications

  • Lang Publisher Version: 10.2.1
  • Laravel Version: 8.67.0
  • PHP Version: 8.0.10

Description:

Hi,
First thanks for your package I use on several projects !
I'm facing an issue : keys from Notifications (in /vendor/laravel/framework/src/Illuminate/Auth/Notifications) are not included in json files while they are present in https://github.com/Laravel-Lang/lang

Do you have an idea why this happens ?

Thanks !

Steps To Reproduce:

Publish files for french => Search for "Reset Password Notification" in fr.json => not present

Namespace change

@caouecs, hi!

I decided to push my repository to the organization. In the near future I will prepare changes to the package name and namespace.

I need your help now. I do not have access to the settings of this repository. Can you change the name of the project from laravel-lang-publisher to publisher?

When installing a language laravel breeze is not detected

  • Lang Publisher Version: 10.0.1
  • Laravel Version: 8.43.0
  • PHP Version: 8.0.3

Description:

This program don't translate laravel breeze keys.
If i want use laravel breeze instead laravel jetstream (with fortify), the keys aren't translated

Steps To Reproduce:

  • Install a new laravel project laravel new my-project
  • cd my-project
  • Install laravel breeze composer require laravel/breeze --dev
  • run breeze command php artisan breeze:install, then npm install, npm run dev, php artisan migrate.
  • install lang-publisher composer require andrey-helldar/laravel-lang-publisher --dev
  • Set some language, for example spanish php artisan lang:add es
  • Set locale to es in config/app.php
  • Go to route register for example (This view is not translate)

i guess laravel breeze uses translations from laravel jestream and that's the reason why it doesn't work.

Missing keys after lang:add XX

Environment

  • Laravel-Lang Publisher Version: v14.7.0
  • Laravel Version: v9.52.14
  • PHP Version: 8.2.1

Issue description

When I add php artisan lang:add de or php artisan lang:add es or any other language then validation.php is created however keys are missing. There are no translations of validation errors etc... Here is the file:

<?php

declare(strict_types=1);

return [
    'attributes' => [
        'address'                  => 'Adresse',
        'age'                      => 'Alter',
        'amount'                   => 'Höhe',
        'area'                     => 'Gebiet',
        'available'                => 'Verfügbar',
        'birthday'                 => 'Geburtstag',
        'body'                     => 'Körper',
        'city'                     => 'Stadt',
        'content'                  => 'Inhalt',
        'country'                  => 'Land',
        'created_at'               => 'Erstellt am',
        'creator'                  => 'Ersteller',
        'current_password'         => 'Derzeitiges Passwort',
        'date'                     => 'Datum',
        'date_of_birth'            => 'Geburtsdatum',
        'day'                      => 'Tag',
        'deleted_at'               => 'Gelöscht am',
        'description'              => 'Beschreibung',
        'district'                 => 'Bezirk',
        'duration'                 => 'Dauer',
        'email'                    => 'E-Mail-Adresse',
        'excerpt'                  => 'Auszug',
        'filter'                   => 'Filter',
        'first_name'               => 'Vorname',
        'gender'                   => 'Geschlecht',
        'group'                    => 'Gruppe',
        'hour'                     => 'Stunde',
        'image'                    => 'Bild',
        'last_name'                => 'Nachname',
        'lesson'                   => 'Lektion',
        'line_address_1'           => 'Adresszeile 1',
        'line_address_2'           => 'Adresszeile 2',
        'message'                  => 'Nachricht',
        'middle_name'              => 'Zweitname',
        'minute'                   => 'Minute',
        'mobile'                   => 'Handynummer',
        'month'                    => 'Monat',
        'name'                     => 'Name',
        'national_code'            => 'Länderkennung',
        'number'                   => 'Nummer',
        'password'                 => 'Passwort',
        'password_confirmation'    => 'Passwortbestätigung',
        'phone'                    => 'Telefonnummer',
        'photo'                    => 'Foto',
        'postal_code'              => 'Postleitzahl',
        'price'                    => 'Preis',
        'province'                 => 'Provinz',
        'recaptcha_response_field' => 'Captcha-Feld',
        'remember'                 => 'Erinnern',
        'restored_at'              => 'Wiederhergestellt am',
        'result_text_under_image'  => 'Ergebnistext unter Bild',
        'role'                     => 'Rolle',
        'second'                   => 'Sekunde',
        'sex'                      => 'Geschlecht',
        'short_text'               => 'Kurzer Text',
        'size'                     => 'Größe',
        'state'                    => 'Bundesland',
        'street'                   => 'Straße',
        'student'                  => 'Schüler/Student',
        'subject'                  => 'Gegenstand',
        'teacher'                  => 'Lehrer',
        'terms'                    => 'Bedingungen',
        'test_description'         => 'Test Beschreibung',
        'test_locale'              => 'Test Region',
        'test_name'                => 'Testname',
        'text'                     => 'Text',
        'time'                     => 'Uhrzeit',
        'title'                    => 'Titel',
        'updated_at'               => 'Aktualisiert am',
        'username'                 => 'Benutzername',
        'year'                     => 'Jahr',
    ],
];

Steps to reproduce

  1. php artisan lang:add es
  2. validation.php is created with missing keys

The "vendor/caouecs/laravel-lang/src" directory does not exist.

  • Lang Publisher Version: <= 4.9.0 and <= 5.2.0

Replace

'vendor' => base_path('vendor/caouecs/laravel-lang'),

to

'vendor' => base_path('vendor/laravel-lang/lang'),

in the config/lang-publisher.php file of your app, or delete this key, then run composer update

Information: Lost `laravel-lang/lang` on update

Actions

Run the composer update and updated the package to 11.2.1 version.

The following message appeared in the console:

Removing laravel-lang/lang

What happened

Starting with publisher version 11.2, we switched to a new model, now this package is not tied to a specific project with translations, in addition, such changes reduce code duplication when testing the laravel-lang/lang repository.

How to fix it

Starting from version 11.2, you need to install the laravel-lang/lang dependency in your application yourself:

composer require laravel-lang/publisher laravel-lang/lang --dev

We have updated the documentation section about this: https://laravel-lang.github.io/publisher/installation.html


PS: @Laravel-Lang/laravel-lang, those of you who use this publisher will also be interesting🙂

Add files from a custom plugin

Environment

Note: this is not a "bug" but when I click on "Questions & Other" there is a 404 error

  • Laravel-Lang Publisher Version: 14.6.2
  • Laravel Version: 10.5.1
  • PHP Version: 8.2.4

Issue description

I've try to create a plugin for the common language terms i use in my applications "Generic term translations for Laravel"

But when I add the files through the publisher, they are well copied, but contain empty arrays.

I only used PHP files whether in the "source" and "locales" directories.

I wonder if it's the absence of a .json file that causes this or just an oversight on my part or a bad way of doing it.

Maybe there is a plugin development tool to generate the necessary, I know there is the plugin template but I want to start from scratch to better understand the mechanisms.

Steps to reproduce

Install the package:

composer require forxer/generic-term-translations-for-laravel --dev

Run:

 php artisan lang:update

Ps: I had already installed before laravel-lang/common

Constant expression contains invalid operations

  • Lang Publisher Version: 14.3.1
  • Laravel Version: 9.27.0
  • PHP Version: 8.1.4

Description:

I've install Lang publisher, set the lang and all work great. But thrice a minute in the laravel.log appear the messages:
local.ERROR: Constant expression contains invalid operations {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Constant expression contains invalid operations at .../vendor/laravel-lang/publisher/src/Helpers/Config.php:30)
[stacktrace]
#0 {main}
"}

Steps To Reproduce:

Just install the publisher and set the lang.

Keys inside attributes array removed when update

  • Lang Publisher Version: 10.0.4
  • Laravel Version: 8.45.1
  • PHP Version: 8.0.7

Description:

When run php artisan lang:update all keys within attributes array removed for all locales but en.

Steps To Reproduce:

  • install any locale.
  • add translation keys within attributes array.
  • run 'php artisan lang:update'.

ISO locales

  • Lang Publisher Version: 12.2.1
  • Laravel Version: 8.83.1
  • PHP Version: 8.0.1

Some projects uses iso locales, for example en_US, ca_ES or even en_GB.utf8 (don't ask) etc. For such locales publisher provides empty files...

May be it should fallback to the known locale?

`lang:update` breaks dot notation in the "attributes" (validation.php) and converts it into an array

  • Lang Publisher Version: v14.2.0
  • Laravel Version: v9.25.1
  • PHP Version: 8.1.9

Description:

After using php artisan lang:update the package breakes the dot notation in the validation.php in the attributes array and converts it into an array.

Here is my attributes array:

<?php

return [
    'attributes' => [
        'timeplan.monday.0.0' => 'Monday (from)',
        'timeplan.monday.0.1' => 'Monday (to)',
        'timeplan.monday.1.0' => 'Monday (from)',
        'timeplan.monday.1.1' => 'Monday (to)',
        'timeplan.monday.2.0' => 'Monday (from)',
        'timeplan.monday.2.1' => 'Monday (to)',
        'timeplan.monday.3.0' => 'Monday (from)',
        'timeplan.monday.3.1' => 'Monday (to)',
        'timeplan.monday.4.0' => 'Monday (from)',
        'timeplan.monday.4.1' => 'Monday (to)',
    ]
];

After using php artisan lang:update the attributes array becomes this:

<?php

return [
    'attributes' => [
        'timeplan' => [
            'monday'    => [
                '0' => [
                    '0' => 'Monday (from)',
                    '1' => 'Monday (to)',
                ],
                '1' => [
                    '0' => 'Monday (from)',
                    '1' => 'Monday (to)',
                ],
                '2' => [
                    '0' => 'Monday (from)',
                    '1' => 'Monday (to)',
                ],
                '3' => [
                    '0' => 'Monday (from)',
                    '1' => 'Monday (to)',
                ],
                '4' => [
                    '0' => 'Monday (from)',
                    '1' => 'Monday (to)',
                ],
            ],
        ]
    ]
];

Now laravel gives me an error because the field is an array and not a string.

  mb_strtoupper(): Argument #1 ($string) must be of type string, array given

  at vendor/laravel/framework/src/Illuminate/Support/Str.php:902
    898▕      * @return string
    899▕      */
    900▕     public static function upper($value)
    901▕     {
  ➜ 902▕         return mb_strtoupper($value, 'UTF-8');
    903▕     }
    904▕ 
    905▕     /**
    906▕      * Convert the given string to title case.

      +9 vendor frames 
  10  app/Http/Livewire/User/UpdateTimeplanForm.php:98
      Livewire\Component::validate()

      +31 vendor frames 
  42  tests/Feature/User/UpdateTimeplanForm.php:143
      Livewire\Testing\TestableLivewire::call("update")

Steps To Reproduce:

Add the attributes array like in the discription to the validation.php and run php artisan lang:update

Why "lang:add" always implicitly includes en?

  • Lang Publisher Version: 11.1.9
  • Laravel Version: 8.73.2
  • PHP Version: 7.4.10

Description:

When I run php artisan lang:add de, it also overwrites my en files. Shouldn't it only add de in this case?

Steps To Reproduce:

  1. Run php artisan lang:add de
  2. See your en files getting overwritten

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.