开源软件名称(OpenSource Name):stevegrunwell/lost-in-translation开源软件地址(OpenSource Url):https://github.com/stevegrunwell/lost-in-translation开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Lost in TranslationLost in Translation is designed to help developers locate instances of localization strings within a Laravel application that haven't been provided translations. InstallationLost in Translation can be installed into your Laravel project via Composer: $ composer require stevegrunwell/lost-in-translation By default, this will replace the default ConfigurationBy default, Lost in Translation will catch missing translations in two ways:
Either of these can be disabled via the package's configuration, making Lost in Translation safe to use in production. These values can be set using the following environment variables:
To override package configuration, run the following to copy the configuration to your app's $ php artisan vendor:publish --provider="LostInTranslation\Providers\TranslationServiceProvider" This will create a new file in ExtendingWhen a missing translation is found, the a First, create a new event listener in your application; in this example, we're using <?php
namespace App\Listeners;
use LostInTranslation\Events\MissingTranslationFound;
class NotifyOfMissingTranslation
{
/**
* Handle the event.
*
* @param MissingTranslationFound $event
*
* @return void
*/
public function handle(MissingTranslationFound $event)
{
// Do something with the event.
}
} The
Then, in /**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'LostInTranslation\Events\MissingTranslationFound' => [
'App\Listeners\NotifyOfMissingTranslation',
],
]; For more on event listeners, please see the Laravel Events documentation. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论