October CMS resources and help articles

Simple and to the point. Optimized by the community.

Override other plugins' localization strings from within your plugin's /lang folder

by mjauvin, last modified on July 23rd, 2020

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)

    $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.



We use cookies to measure the performance of this website. Do you want to accept these cookies?