silverbux / laravel-angular-admin

Laravel + Angularjs + Bootstrap + AdminLTE binded by Gulp workflow Admin Dashboard Boilerplate / Starter.
http://silverbux.github.io/laravel-angular-admin/
MIT License
923 stars 414 forks source link

[Question]: Angular Translate #67

Open llstarscreamll opened 8 years ago

llstarscreamll commented 8 years ago

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!! ^_^

gioramies commented 7 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?

gnud commented 7 years ago

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');
}

Finally to use it in the template views:

<h1>Some text {{ 'TITLE' | translate }}</h1>