Reputation: 9789
Lets say I want to have an icon inline in the text
'Please scan the <span class="icon ion-barcode"></span> on the screen'
How would i add that to a translation with angular-translate without splitting the sentence into two parts ?
'{{ 'scan_1' | translate }}
<span class="icon icon-barcode"></span>
{{ 'scan_2' | translate }}'
....
.config(['$translateProvider', function ($translateProvider) {
var translations = {
en : {
scan_1 : 'Please scan the',
scan_2 : 'on the screen',
}
};
$translateProvider
.translations('en', translations.en)
.preferredLanguage('en');
}])
Upvotes: 4
Views: 1374