Last active
October 12, 2017 13:47
-
-
Save francisrod01/252fd454ecf58ed1a6618218b1ced25c to your computer and use it in GitHub Desktop.
angularJs - doubt with translate loaderPartial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
var core = angular.module('app.core'); | |
core.config(translations); | |
/* @ngInject */ | |
function translations($translateProvider) { | |
$translateProvider.preferredLanguage('en'); | |
$translateProvider.useLoader('$translatePartialLoader', { | |
urlTemplate: '/app/**/{part}/i18n/{lang}.json' | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- I add scripts in this order: --> | |
<script src="bower_components/javascripts/jquery.js"></script> | |
<script src="bower_components/javascripts/angular.js"></script> | |
<script src="bower_components/javascripts/ng-bootstrap.min.js"></script> | |
<script src="bower_components/javascripts/angular-sanitize.js"></script> | |
<script src="bower_components/javascripts/angular-translate.js"></script> | |
<script src="bower_components/javascripts/angular-translate-interpolation-messageformat.js"></script> | |
<script src="bower_components/javascripts/angular-translate-loader-partial.js"></script> | |
<script src="bower_components/javascripts/messageformat.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Screenshot the bug: https://snag.gy/BZch29.jpg | |
raw text: | |
'HOMEPAGE.TITLE' | |
'HOMEPAGE.DESC' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular | |
.module('app.toolbar') | |
.controller('Toolbar', Toolbar); | |
function Toolbar($translatePartialLoader) { | |
/*jshint validthis: true */ | |
var vm = this; | |
activate(); | |
function activate() { | |
loadTranslation(); | |
} | |
function loadTranslation() { | |
$translatePartialLoader.addPart('toolbar'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="navbar-brand" href="#">{{'TOOLBAR.HELLO' | translate}}</a> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment