Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
fix(directive): Make interpolate message format work smoothly also on…
Browse files Browse the repository at this point in the history
… message format > 0.1.7 - fixes #789
  • Loading branch information
tspaeth authored and knalli committed Apr 9, 2015
1 parent dec4bf3 commit 2533f2d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/directive/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ angular.module('pascalprecht.translate')
}

if (angular.equals(translationId , '') || !angular.isDefined(translationId)) {
// initially fetch all attributes if existing and fill the params
if (translateValueExist) {
for (var attr in tAttr) {
if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {
var attributeName = angular.lowercase(attr.substr(14, 1)) + attr.substr(15);
scope.interpolateParams[attributeName] = tAttr[attr];
}
}
}

// Resolve translation id by inner html if required
var interpolateMatches = trim.apply(iElement.text()).match(interpolateRegExp);
// Interpolate translation id if required
Expand Down

0 comments on commit 2533f2d

Please sign in to comment.