Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11: After installation package app read translations from resources/lang instead /lang #100

Open
stefanrakicfaxi opened this issue Nov 22, 2024 · 3 comments

Comments

@stefanrakicfaxi
Copy link

I have an issue because package override my lang directory:
This is example of fix from another package:
public function boot()
{
$configPath = DIR.'/../../config/config.php';
$configKey = 'localization-js';

    // Determines Laravel major version.
    $app = $this->app;
    $laravelMajorVersion = (int) $app::VERSION;

    // Publishes Laravel-JS-Localization package files and merge user and
    // package configurations.
    if ($laravelMajorVersion === 4) {
        $config = $this->app['config']->get($configKey, []);
        $this->app['config']->set($configKey, array_merge(require $configPath, $config));
    } elseif ($laravelMajorVersion >= 5) {
        $this->publishes([
            $configPath => config_path("$configKey.php"),
        ]);
        $this->mergeConfigFrom(
            $configPath, $configKey
        );
    }
}
@nnjeim
Copy link
Owner

nnjeim commented Nov 27, 2024

@stefanrakicfaxi thank you for you input. would you be interested to submit a PR with the proposed modification?

@nnjeim
Copy link
Owner

nnjeim commented Nov 27, 2024

@stefanrakicfaxi
when publishing the resources of the package the files are under
/resources/lang/vendor/world
what is the issue in your case with this?

@alqabali
Copy link

@nnjeim in the laravel 11 the translation/language files should be in the root lang folder not resources/lang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants