Documentation

TranslatorServiceProvider
in package
implements ServiceProviderInterface

Registers the Translator as a singleton and sets the active locale from the database during the boot phase.

Tags
since
3.0.0

Table of Contents

Interfaces

ServiceProviderInterface
Interface for service providers that register services in the container.

Methods

boot()  : void
Read the user's locale preference from settings and apply it.
register()  : void
Register the Translator singleton.

Methods

boot()

Read the user's locale preference from settings and apply it.

public boot(Container $container) : void

Runs after all providers are registered, so the DB is available. Silently defaults to English if the DB is not yet configured (e.g. during the setup wizard).

Parameters
$container : Container

The DI container


        
On this page

Search results