php - Unify ZF2 Translator and AngularJS localization -


i built application uses zf2 authentification, routing, error pages etc., core functionalities on each view implemented in angularjs. whole thing localized, in 2 seperate instances:

we have zf2 translator, configured in module.config.php

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

containing key=>value pairs 'app.frontend.title' => 'title'.

and angular-translate module, configured by

$translateprovider.usestaticfilesloader({     prefix: '/lang/',     suffix: '.json' }); 

containing nested json object {'app': {'buttons': {'send': 'send now'}}}'

the php part contains headlines, content <title>, navigation,... pretty displayed outside of angularjs apps. angular-json contains l10n lot of buttons, dialogs etc.

is there possibility unify these two? doesn't matter if access angularjs json file php script or other way round (get .json dynamically served php angular). can't figure out how read json zf2 translator.

why have have translations handled php , others angular js? couldn't rid of zf2 translator?


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -