统一 ZF2 翻译器和 AngularJS 本地化

Unify ZF2 Translator and AngularJS localization

我构建了一个使用 ZF2 进行身份验证、路由、错误页面等的应用程序,但每个视图的核心功能都是在 AngularJS 中实现的。整个事情是本地化的,但在 2 个不同的实例中:

我们有 ZF2 翻译器,配置在 module.config.php

'translator' => array(
    'locale' => 'de_DE',
    'translation_file_patterns' => array(
        array(
            'type'     => 'phparray',
            'base_dir' => __DIR__ . '/../language',
            'pattern'  => '%s.php',
        ),
    ),
),

包含键=>值对,如 'app.frontend.title' => 'Title'

和Angular-Translate模块,由

配置
$translateProvider.useStaticFilesLoader({
    prefix: '/lang/',
    suffix: '.json'
});

包含嵌套的 JSON object 如 {'app': {'buttons': {'send': 'Send now'}}}'

PHP 部分包含一些标题、<title> 的内容、导航……几乎所有在我的 AngularJS 应用程序之外显示的内容。 Angular-JSON 包含很多按钮、对话框等的 l10n。

这两者有统一的可能吗?如果我从 php 脚本或相反的方式访问 AngularJS json 文件并不重要(获取由 PHP 动态提供的 .json对于 Angular)。但我不知道如何阅读 ZF2 翻译器的 JSON。

为什么要让 PHP 处理一些翻译,而让 Angular JS 处理另一些翻译?不能去掉 ZF2 翻译器吗?