Jump to content

Recommended Posts

Posted

Hi.

I'm trying to translate the title and nav items for my custom process module from ProcessName.info.php

$info = array(
	'page' => array(
		'name' => 'authors',
		'parent' => '',
		'title' =>  __('Authors')
	),

	'nav' => array(
		array(
			'url' => 'add/',
			'label' => __('Add'),
			'icon' => 'plus',
		),
		array(
			'url' => './',
			'label' => __('Manage'),
			'icon' => 'list',
		),
		array(
			'url' => 'trash/',
			'label' => __('Trash'),
			'icon' => 'trash-o',
		),
	)

);

But it doesn't work nor for the title, neither for nav items.

If I use getModuleInfo method that is placed inside ProcessName.module.php I was able to get translations for nav items, but not for the title

public static function getModuleInfo() {
	'page' => array(
		'name' => 'authors',
		'parent' => '',
		'title' =>  __('Authors')
	),

	'nav' => array(
		array(
			'url' => 'add/',
			'label' => __('Add'),
			'icon' => 'plus',
		),
		array(
			'url' => './',
			'label' => __('Manage'),
			'icon' => 'list',
		),
		array(
			'url' => 'trash/',
			'label' => __('Trash'),
			'icon' => 'trash-o',
		),
	)
	)
}

I'm was digging in AdminThemeFramework.php and has found how it works for default admin pages, but can't understand how I can get it to work with custom module/pages. 

Thanks in advance. 

Eugene.

  • 3 months later...
Posted

I have the same problem. Tried to make strings translatable in module.info.php, but I get an error "__" is not a function. Do you mean "___" ...

  • 2 months later...
Posted

Hello,

old topic, but maybe you can try another syntax using $this->_('....')

Or from @Zeka example:

'page' => array(
		'name' => 'authors',
		'parent' => '',
		'title' => $this->_('Authors')
	),

Regards.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...