Open llstarscreamll opened 8 years ago
Hi, I'm trying with bower install angular-translate, but don't know how to embed the .js in the project. https://angular-translate.github.io/docs/#/guide
Where can I start?
For a reference if someone needs it :), it's tested, however the steps described are not well thought, if someone find it difficult or runs in a dead end, let me know, I will rewrite this guide :).
1) installation:
bower install angular-translate --save
2) module inject:
angular.module('app.components', [
'ui.router', 'angular-loading-bar',
'restangular', 'ngStorage', 'satellizer',
'ui.bootstrap', 'chart.js', 'mm.acl', 'datatables',
'datatables.bootstrap', 'checklist-model',
'pascalprecht.translate'
])
3) configure package
export function TranslateConfig ($translateProvider) {
'ngInject'
$translateProvider.useStaticFilesLoader({
prefix: '/langs/',
suffix: '.json'
});
$translateProvider.preferredLanguage('en');
}
{
"MAIN_MENU": "Bla bla menu"
}
Finally to use it in the template views:
<h1>Some text {{ 'TITLE' | translate }}</h1>
Hi!! This is very nice package,congrats and thank you for sharing it! Many helpful features are implemented here, but what about angular multi language support? have you considered adding this feature? I'm trying it with angular translate, but can't make it work on step "Asynchronous Loading" from the package documentation...
Have multi language feature would be great!!
hey!! Thanks again!! ^_^