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

Commit

Permalink
fix(custom interpolator): improve handling of interpolator ids which …
Browse files Browse the repository at this point in the history
…don't exist
  • Loading branch information
liamkeaton authored and knalli committed Mar 1, 2015
1 parent ed79eda commit 373b46f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/service/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,12 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
var determineTranslationInstant = function (translationId, interpolateParams, interpolationId) {

var result, table = $uses ? $translationTable[$uses] : $translationTable,
Interpolator = (interpolationId) ? interpolatorHashMap[interpolationId] : defaultInterpolator;
Interpolator = defaultInterpolator;

// if the interpolation id exists use custom interpolator
if (interpolatorHashMap && Object.prototype.hasOwnProperty.call(interpolatorHashMap, interpolationId)) {
Interpolator = interpolatorHashMap[interpolationId];
}

// if the translation id exists, we can just interpolate it
if (table && Object.prototype.hasOwnProperty.call(table, translationId)) {
Expand Down

0 comments on commit 373b46f

Please sign in to comment.