possibility to publish translations for packages not installed #227
Replies: 4 comments
-
The opportunity is already there. There are two options. Option 1: if translations need to be published always when your file package is installed in the application, then simply do not specify Option 2: you can specify |
Beta Was this translation helpful? Give feedback.
-
ehm, editing the package files in the vendor folder? they are not pushed to git and so not in the live project? |
Beta Was this translation helpful? Give feedback.
-
Uh, hold on. Why would they need to get into git? Translation source files are not needed in production. That means you install them during development and run a command to publish them. Do I understand correctly that you want to force the Fortify translations to be installed in your project? If yes, then:
namespace App\Http\Providers;
use App\Translations\Plugin;
use Illuminate\Support\ServiceProvider;
use LaravelLang\Publisher\Plugins\Provider;
class TranslationsServiceProvider extends ServiceProvider
{
public function register(): void
{
if (class_exists(Provider::class)) {
$this->app->register(Plugin::class);
}
}
} namespace App\Translations;
use LaravelLang\Lang\Plugins\Fortify\V1;
use LaravelLang\Publisher\Plugins\Provider;
class Plugin extends Provider
{
protected string $base_path = __DIR__ . '/../vendor/laravel-lang/lang/';
protected array $plugins = [
V1::class,
];
} |
Beta Was this translation helpful? Give feedback.
-
Thx for the quick hack! The translations are continuously improved with every update, so it is part of my Jenkins CI/CD pipeline to regenerate them before deploying to production. Fortify is installed, so I get the translations for validation and error messages. However, I use custom Blade views for the authentication forms and wanted to reuse the Jetstream translations for field labels like "remember me", "email", etc. I would like to force certain package translations to be published even if the package is not present, in this case jetstream. My idea to implement this would be a new configuration option like: 'force_install' => [ This array could be merged into the list of detected installed packages before translations are generated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature description
a config option to list not installed packages there to get their translations published too would be nice.
use case: I'm writing own auth views for fortify, and wanted to use the translations from jetstream for the forms, but without jetstream installed they are not published, so no translation.
Beta Was this translation helpful? Give feedback.
All reactions