Skip to content

Allows to easily setup the locale in OctoberCMS plugin components

License

Notifications You must be signed in to change notification settings

TaemaInc/OctoberTranslatableTrait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Add the trait to the component and call the setupLocale method in onRun

<?php namespace Vendor\Plugin\Components;

use Cms\Classes\ComponentBase;
use Lunfel\OctoberCMS\Translation\TranslatableComponentTrait;

class MyComponent extends ComponentBase
{
    use TranslatableComponentTrait;

    public function componentDetails()
    {
        return [
            'name'        => '...',
            'description' => '...'
        ];
    }

    public function defineProperties()
    {
        return [];
    }

    public function onRun()
    {
        $this->setupLocale();
    }
}

About

Allows to easily setup the locale in OctoberCMS plugin components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages