Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUYA Composer Extensions with Translations in Module #1448

Closed
nadar opened this issue Sep 5, 2017 · 1 comment
Closed

LUYA Composer Extensions with Translations in Module #1448

nadar opened this issue Sep 5, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@nadar
Copy link
Member

nadar commented Sep 5, 2017

When using a luya extension with translations inside the module, but the blocks are loaded via composer plugin, an exception is thrown as the blocks can not be found.

message":"Unable to locate message source for category 'bootstrap4'
@nadar nadar added this to the 1.0.0-RC4 milestone Sep 5, 2017
@nadar nadar self-assigned this Sep 5, 2017
@nadar nadar added the bug label Sep 5, 2017
nadar added a commit that referenced this issue Sep 5, 2017
@nadar nadar closed this as completed Sep 5, 2017
@nadar
Copy link
Member Author

nadar commented Sep 5, 2017

Example

class Module extends \luya\base\Module
{
	public static function onLoad()
	{
		self::registerTranslation('baseblocks', static::staticBasePath() . '/messages', [
			'baseblocks' => 'baseblocks.php',
		]);
	}
	
    
    public static function t($message, array $params = [])
    {
        return parent::baseT('baseblocks', $message, $params);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant