我在 Zend 2 项目中使用ZfcUser。但我必须使用意大利语翻译而不是英文翻译。
我在翻译器属性中的项目模块/应用程序/config/module.config.php 中进行了更改,并且都以意大利语开头,而不是模块的一部分。
在目录 vendor/ZfcUser/src/ZfcUser/language 中有 it_IT.po 和 it_IT.mo 文件。
没变化。如何将我的应用程序的语言与模块链接起来?
MOD1:
我添加了翻译器,但似乎没有任何效果
添加代码:
return array(
'view_manager' => array(
'template_path_stack' => array(
'zfcuser' => __DIR__ . '/../view',
),
),
'controllers' => array(
'invokables' => array(
'zfcuser' => 'ZfcUser\Controller\UserController',
),
),
'service_manager' => array(
'aliases' => array(
'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
'translator' => 'MvcTranslator',
),
),
'router' => array(
'routes' => array(
'zfcuser' => array(
'type' => 'Literal',
'priority' => 1000,
'options' => array(
'route' => '/utente',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'login' => array(
'type' => 'Literal',
'options' => array(
'route' => '/login',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'login',
),
),
),
'authenticate' => array(
'type' => 'Literal',
'options' => array(
'route' => '/autenticati',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'authenticate',
),
),
),
'logout' => array(
'type' => 'Literal',
'options' => array(
'route' => '/logout',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'logout',
),
),
),
'register' => array(
'type' => 'Literal',
'options' => array(
'route' => '/registrazione',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'register',
),
),
),
'changepassword' => array(
'type' => 'Literal',
'options' => array(
'route' => '/cambia-password',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'changepassword',
),
),
),
'changeemail' => array(
'type' => 'Literal',
'options' => array(
'route' => '/cambia-email',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'changeemail',
),
),
),
),
),
),
),
'translator' => array(
'locale' => 'it_IT',
'translation_file_patterns' => array(
array(
'type' => 'gettext',
'base_dir' => __DIR__ . '/../language',
'pattern' => '%s.mo',
),
),
)
);
提前致谢