Override other plugins' localization strings from within your plugin's /lang folder
1
October allows overriding other plugin's localization strings under the application's /lang
folder by default (see doc here).
By overriding your plugin's constructor (as show below), you can now include localization string overrides for other plugins within your plugin's /lang
folder:
public function __construct($app)
{
parent::__construct($app);
$app->singleton('translation.loader', function ($app) {
$nsPath = str_replace('\\', DIRECTORY_SEPARATOR, strtolower(__NAMESPACE__));
$langPath = plugins_path($nsPath . '/lang');
return new \October\Rain\Translation\FileLoader($app['files'], $langPath);
});
}
*** WARNING: you can no longer use the Application's /lang
folder to override localization strings.
There are no comments yet
Be the first one to comment