Jump to content
Zeka

How to translate module's process page title and nav items?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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 "___" ...

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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