Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-translate

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-translate - npm Package Compare versions

Comparing version 2.5.2 to 2.6.0

26

CHANGELOG.md

@@ -0,1 +1,27 @@

<a name="2.6.0"></a>
## 2.6.0 (2015-02-08)
#### Bug Fixes
* **directive:**
* newlines before/after translation ids should be ignored ([8dcf3e23](http://github.com/angular-translate/angular-translate/commit/8dcf3e23e9623b59f71c4b18c19a066f649b7bdf), closes [#909](http://github.com/angular-translate/angular-translate/issues/909))
* fix missing update using dynamic translationIds ([faebe195](http://github.com/angular-translate/angular-translate/commit/faebe19598d35ac31678cce028d61c87ecd4b20a), closes [#854](http://github.com/angular-translate/angular-translate/issues/854))
* ensure internal watcher will be removed ([e69f4a14](http://github.com/angular-translate/angular-translate/commit/e69f4a14ccb4c549250900696c58ae4ede71c656))
* fix minor memory leak ([5e4533a4](http://github.com/angular-translate/angular-translate/commit/5e4533a4a485672ab7e1675d5d1a11f689e5d6ad))
* **filter:** apply notFoundIndicators also for instant translations correctly ([5a9f436f](http://github.com/angular-translate/angular-translate/commit/5a9f436fb8444d4992b00383bd37b61580e816d4), closes [#866](http://github.com/angular-translate/angular-translate/issues/866))
* **service:**
* fix an issue with default interpolator and expressions ([75b7381f](http://github.com/angular-translate/angular-translate/commit/75b7381fbfbb342b98a7fe8f9a9b7915004dc66c))
* use $window/$windowProvider instead of window fix(docs): update ngdocs on storag ([bfa7b7b2](http://github.com/angular-translate/angular-translate/commit/bfa7b7b28f6e2698205e774b4d13d34d85abfc2f))
* fallback languages follow shortcuts (fixes #758) ([cce897a3](http://github.com/angular-translate/angular-translate/commit/cce897a34a2087c6799cd11889bc90db3c56f227))
#### Features
* **$translatePartialLoader:** adds optional priority param to the addPart function ([570617cf](http://github.com/angular-translate/angular-translate/commit/570617cf68804fdd21ba215d9a6a7c4b3083fd2a))
* **directive:** add $translateProvider.directityPriority ([b0b77162](http://github.com/angular-translate/angular-translate/commit/b0b771624cda1a51879c7f685f98e90923d4a3b0))
* **loader:** support for multiple static translation files ([c462ee6a](http://github.com/angular-translate/angular-translate/commit/c462ee6aa6f095f3cd7e1b5ebc9d4b4d135c1ae2))
* **service:** extend loader api: add isPartLoaded and getRegisteredParts to $translatePartialL ([54f8ab3e](http://github.com/angular-translate/angular-translate/commit/54f8ab3e166fa2e1ef1c1334263f9df612a4940e))
<a name="2.5.2"></a>

@@ -2,0 +28,0 @@ ### 2.5.2 (2014-12-10)

4

dist/angular-translate-handler-log/angular-translate-handler-log.js
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -6,0 +6,0 @@ angular.module('pascalprecht.translate')

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").factory("$translateMissingTranslationHandlerLog",["$log",function(a){return function(b){a.warn("Translation for "+b+" doesn't exist")}}]);
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -6,0 +6,0 @@ angular.module('pascalprecht.translate')

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").constant("TRANSLATE_MF_INTERPOLATION_CACHE","$translateMessageFormatInterpolation").factory("$translateMessageFormatInterpolation",["$cacheFactory","TRANSLATE_MF_INTERPOLATION_CACHE",function(a,b){var c={},d=a.get(b),e=new MessageFormat("en"),f="messageformat",g=null,h={escaped:function(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=angular.element("<div></div>").text(a[c]).html());return b}},i=function(a){var b;return b=angular.isFunction(h[g])?h[g](a):a};return d||(d=a(b)),d.put("en",e),c.setLocale=function(a){e=d.get(a),e||(e=new MessageFormat(a),d.put(a,e))},c.getInterpolationIdentifier=function(){return f},c.useSanitizeValueStrategy=function(a){return g=a,this},c.interpolate=function(a,b){b=b||{},g&&(b=i(b));var c=d.get(a+angular.toJson(b));return c||(c=e.compile(a)(b),d.put(a+angular.toJson(b),c)),c},c}]);
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -26,6 +26,7 @@ angular.module('pascalprecht.translate')

*/
function Part(name) {
function Part(name, priority) {
this.name = name;
this.isActive = true;
this.tables = {};
this.priority = priority || 0;
}

@@ -111,3 +112,16 @@

function getPrioritizedParts() {
var prioritizedParts = [];
for(var part in parts) {
if (parts[part].isActive) {
prioritizedParts.push(parts[part]);
}
}
prioritizedParts.sort(function (a, b) {
return a.priority - b.priority;
});
return prioritizedParts;
}
/**

@@ -124,2 +138,4 @@ * @ngdoc function

* @param {string} name A name of the part to add
* @param {int} [priority=0] Sets the load priority of this part.
*
* @returns {object} $translatePartialLoaderProvider, so this method is chainable

@@ -130,3 +146,3 @@ * @throws {TypeError} The method could throw a **TypeError** if you pass the param

*/
this.addPart = function(name) {
this.addPart = function(name, priority) {
if (!isStringValid(name)) {

@@ -137,3 +153,3 @@ throw new TypeError('Couldn\'t add part, part name has to be a string!');

if (!hasPart(name)) {
parts[name] = new Part(name);
parts[name] = new Part(name, priority);
}

@@ -281,37 +297,25 @@ parts[name].isActive = true;

var loaders = [],
tables = [],
deferred = $q.defer();
deferred = $q.defer(),
prioritizedParts = getPrioritizedParts();
function addTablePart(table) {
tables.push(table);
}
angular.forEach(prioritizedParts, function(part, index) {
loaders.push(
part.getTable(options.key, $q, $http, options.$http, options.urlTemplate, errorHandler)
);
part.urlTemplate = options.urlTemplate;
});
for (var part in parts) {
if (hasPart(part) && parts[part].isActive) {
loaders.push(
parts[part]
.getTable(options.key, $q, $http, options.$http, options.urlTemplate, errorHandler)
.then(addTablePart)
);
parts[part].urlTemplate = options.urlTemplate;
$q.all(loaders).then(
function() {
var table = {};
angular.forEach(prioritizedParts, function(part) {
deepExtend(table, part.tables[options.key]);
});
deferred.resolve(table);
},
function() {
deferred.reject(options.key);
}
}
);
if (loaders.length) {
$q.all(loaders).then(
function() {
var table = {};
for (var i = 0; i < tables.length; i++) {
deepExtend(table, tables[i]);
}
deferred.resolve(table);
},
function() {
deferred.reject(options.key);
}
);
} else {
deferred.resolve({});
}
return deferred.promise;

@@ -326,7 +330,8 @@ };

* @description
* Registers a new part of the translation table. This method does actually not perform any xhr
* requests to get a translation data. The new parts would be loaded from the server next time
* `angular-translate` asks to loader to loaded translations.
* Registers a new part of the translation table. This method does not actually perform any xhr
* requests to get translation data. The new parts will be loaded in order of priority from the server next time
* `angular-translate` asks the loader to load translations.
*
* @param {string} name A name of the part to add
* @param {int} [priority=0] Sets the load priority of this part.
*

@@ -343,3 +348,3 @@ * @returns {object} $translatePartialLoader, so this method is chainable

*/
service.addPart = function(name) {
service.addPart = function(name, priority) {
if (!isStringValid(name)) {

@@ -350,3 +355,3 @@ throw new TypeError('Couldn\'t add part, first arg has to be a string');

if (!hasPart(name)) {
parts[name] = new Part(name);
parts[name] = new Part(name, priority);
$rootScope.$emit('$translatePartialLoaderStructureChanged', name);

@@ -431,2 +436,44 @@ } else if (!parts[name].isActive) {

* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#isPartLoaded
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Checks if the registered translation part is loaded into the translation table.
*
* @param {string} name A name of the part
* @param {string} lang A key of the language
*
* @returns {boolean} Returns **true** if the translation of the part is loaded to the translation table and **false** if not.
*
* @throws {TypeError} The method could throw a **TypeError** if you pass the param of the wrong
* type. Please, note that the `name` and `lang` params have to be non-empty **string**.
*/
service.isPartLoaded = function(name, lang) {
return angular.isDefined(parts[name]) && angular.isDefined(parts[name].tables[lang]);
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#getRegisteredParts
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Gets names of the parts that were added with the `addPart`.
*
* @returns {array} Returns array of registered parts, if none were registered then an empty array is returned.
*/
service.getRegisteredParts = function() {
var registeredParts = [];
angular.forEach(parts, function(p){
if(p.isActive) {
registeredParts.push(p.name);
}
});
return registeredParts;
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#isPartAvailable

@@ -433,0 +480,0 @@ * @methodOf pascalprecht.translate.$translatePartialLoader

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").provider("$translatePartialLoader",function(){function a(a){this.name=a,this.isActive=!0,this.tables={}}function b(a){return Object.prototype.hasOwnProperty.call(f,a)}function c(a){return angular.isString(a)&&""!==a}function d(a){if(!c(a))throw new TypeError("Invalid type of a first argument, a non-empty string expected.");return b(a)&&f[a].isActive}function e(a,b){for(var c in b)b[c]&&b[c].constructor&&b[c].constructor===Object?(a[c]=a[c]||{},e(a[c],b[c])):a[c]=b[c];return a}a.prototype.parseUrl=function(a,b){return a.replace(/\{part\}/g,this.name).replace(/\{lang\}/g,b)},a.prototype.getTable=function(a,b,c,d,e,f){var g=b.defer();if(this.tables[a])g.resolve(this.tables[a]);else{var h=this;c(angular.extend({method:"GET",url:this.parseUrl(e,a)},d)).success(function(b){h.tables[a]=b,g.resolve(b)}).error(function(){f?f(h.name,a).then(function(b){h.tables[a]=b,g.resolve(b)},function(){g.reject(h.name)}):g.reject(h.name)})}return g.promise};var f={};this.addPart=function(d){if(!c(d))throw new TypeError("Couldn't add part, part name has to be a string!");return b(d)||(f[d]=new a(d)),f[d].isActive=!0,this},this.setPart=function(d,e,g){if(!c(d))throw new TypeError("Couldn't set part.`lang` parameter has to be a string!");if(!c(e))throw new TypeError("Couldn't set part.`part` parameter has to be a string!");if("object"!=typeof g||null===g)throw new TypeError("Couldn't set part. `table` parameter has to be an object!");return b(e)||(f[e]=new a(e),f[e].isActive=!1),f[e].tables[d]=g,this},this.deletePart=function(a){if(!c(a))throw new TypeError("Couldn't delete part, first arg has to be string.");return b(a)&&(f[a].isActive=!1),this},this.isPartAvailable=d,this.$get=["$rootScope","$injector","$q","$http",function(g,h,i,j){var k=function(a){function d(a){l.push(a)}if(!c(a.key))throw new TypeError("Unable to load data, a key is not a non-empty string.");if(!c(a.urlTemplate))throw new TypeError("Unable to load data, a urlTemplate is not a non-empty string.");var g=a.loadFailureHandler;if(void 0!==g){if(!angular.isString(g))throw new Error("Unable to load data, a loadFailureHandler is not a string.");g=h.get(g)}var k=[],l=[],m=i.defer();for(var n in f)b(n)&&f[n].isActive&&(k.push(f[n].getTable(a.key,i,j,a.$http,a.urlTemplate,g).then(d)),f[n].urlTemplate=a.urlTemplate);return k.length?i.all(k).then(function(){for(var a={},b=0;b<l.length;b++)e(a,l[b]);m.resolve(a)},function(){m.reject(a.key)}):m.resolve({}),m.promise};return k.addPart=function(d){if(!c(d))throw new TypeError("Couldn't add part, first arg has to be a string");return b(d)?f[d].isActive||(f[d].isActive=!0,g.$emit("$translatePartialLoaderStructureChanged",d)):(f[d]=new a(d),g.$emit("$translatePartialLoaderStructureChanged",d)),k},k.deletePart=function(a,d){if(!c(a))throw new TypeError("Couldn't delete part, first arg has to be string");if(void 0===d)d=!1;else if("boolean"!=typeof d)throw new TypeError("Invalid type of a second argument, a boolean expected.");if(b(a)){var e=f[a].isActive;if(d){var i=h.get("$translate"),j=i.loaderCache();"string"==typeof j&&(j=h.get(j)),"object"==typeof j&&angular.forEach(f[a].tables,function(b,c){j.remove(f[a].parseUrl(f[a].urlTemplate,c))}),delete f[a]}else f[a].isActive=!1;e&&g.$emit("$translatePartialLoaderStructureChanged",a)}return k},k.isPartAvailable=d,k}]});
angular.module("pascalprecht.translate").provider("$translatePartialLoader",function(){function a(a,b){this.name=a,this.isActive=!0,this.tables={},this.priority=b||0}function b(a){return Object.prototype.hasOwnProperty.call(g,a)}function c(a){return angular.isString(a)&&""!==a}function d(a){if(!c(a))throw new TypeError("Invalid type of a first argument, a non-empty string expected.");return b(a)&&g[a].isActive}function e(a,b){for(var c in b)b[c]&&b[c].constructor&&b[c].constructor===Object?(a[c]=a[c]||{},e(a[c],b[c])):a[c]=b[c];return a}function f(){var a=[];for(var b in g)g[b].isActive&&a.push(g[b]);return a.sort(function(a,b){return a.priority-b.priority}),a}a.prototype.parseUrl=function(a,b){return a.replace(/\{part\}/g,this.name).replace(/\{lang\}/g,b)},a.prototype.getTable=function(a,b,c,d,e,f){var g=b.defer();if(this.tables[a])g.resolve(this.tables[a]);else{var h=this;c(angular.extend({method:"GET",url:this.parseUrl(e,a)},d)).success(function(b){h.tables[a]=b,g.resolve(b)}).error(function(){f?f(h.name,a).then(function(b){h.tables[a]=b,g.resolve(b)},function(){g.reject(h.name)}):g.reject(h.name)})}return g.promise};var g={};this.addPart=function(d,e){if(!c(d))throw new TypeError("Couldn't add part, part name has to be a string!");return b(d)||(g[d]=new a(d,e)),g[d].isActive=!0,this},this.setPart=function(d,e,f){if(!c(d))throw new TypeError("Couldn't set part.`lang` parameter has to be a string!");if(!c(e))throw new TypeError("Couldn't set part.`part` parameter has to be a string!");if("object"!=typeof f||null===f)throw new TypeError("Couldn't set part. `table` parameter has to be an object!");return b(e)||(g[e]=new a(e),g[e].isActive=!1),g[e].tables[d]=f,this},this.deletePart=function(a){if(!c(a))throw new TypeError("Couldn't delete part, first arg has to be string.");return b(a)&&(g[a].isActive=!1),this},this.isPartAvailable=d,this.$get=["$rootScope","$injector","$q","$http",function(h,i,j,k){var l=function(a){if(!c(a.key))throw new TypeError("Unable to load data, a key is not a non-empty string.");if(!c(a.urlTemplate))throw new TypeError("Unable to load data, a urlTemplate is not a non-empty string.");var b=a.loadFailureHandler;if(void 0!==b){if(!angular.isString(b))throw new Error("Unable to load data, a loadFailureHandler is not a string.");b=i.get(b)}var d=[],g=j.defer(),h=f();return angular.forEach(h,function(c){d.push(c.getTable(a.key,j,k,a.$http,a.urlTemplate,b)),c.urlTemplate=a.urlTemplate}),j.all(d).then(function(){var b={};angular.forEach(h,function(c){e(b,c.tables[a.key])}),g.resolve(b)},function(){g.reject(a.key)}),g.promise};return l.addPart=function(d,e){if(!c(d))throw new TypeError("Couldn't add part, first arg has to be a string");return b(d)?g[d].isActive||(g[d].isActive=!0,h.$emit("$translatePartialLoaderStructureChanged",d)):(g[d]=new a(d,e),h.$emit("$translatePartialLoaderStructureChanged",d)),l},l.deletePart=function(a,d){if(!c(a))throw new TypeError("Couldn't delete part, first arg has to be string");if(void 0===d)d=!1;else if("boolean"!=typeof d)throw new TypeError("Invalid type of a second argument, a boolean expected.");if(b(a)){var e=g[a].isActive;if(d){var f=i.get("$translate"),j=f.loaderCache();"string"==typeof j&&(j=i.get(j)),"object"==typeof j&&angular.forEach(g[a].tables,function(b,c){j.remove(g[a].parseUrl(g[a].urlTemplate,c))}),delete g[a]}else g[a].isActive=!1;e&&h.$emit("$translatePartialLoaderStructureChanged",a)}return l},l.isPartLoaded=function(a,b){return angular.isDefined(g[a])&&angular.isDefined(g[a].tables[b])},l.getRegisteredParts=function(){var a=[];return angular.forEach(g,function(b){b.isActive&&a.push(b.name)}),a},l.isPartAvailable=d,l}]});
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -24,20 +24,62 @@ angular.module('pascalprecht.translate')

if (!options || (!angular.isString(options.prefix) || !angular.isString(options.suffix))) {
throw new Error('Couldn\'t load static files, no prefix or suffix specified!');
if (!options || (!angular.isArray(options.files) && (!angular.isString(options.prefix) || !angular.isString(options.suffix)))) {
throw new Error('Couldn\'t load static files, no files and prefix or suffix specified!');
}
if (!options.files) {
options.files = [{
prefix: options.prefix,
suffix: options.suffix
}];
}
var deferred = $q.defer();
var load = function (file) {
if (!file || (!angular.isString(file.prefix) || !angular.isString(file.suffix))) {
throw new Error('Couldn\'t load static file, no prefix or suffix specified!');
}
$http(angular.extend({
url: [
options.prefix,
options.key,
options.suffix
].join(''),
method: 'GET',
params: ''
}, options.$http)).success(function (data) {
deferred.resolve(data);
}).error(function (data) {
deferred.reject(options.key);
var deferred = $q.defer();
$http(angular.extend({
url: [
options.prefix,
options.key,
options.suffix
].join(''),
method: 'GET',
params: ''
}, options.$http)).success(function (data) {
deferred.resolve(data);
}).error(function (data) {
deferred.reject(options.key);
});
return deferred.promise;
};
var deferred = $q.defer(),
promises = [],
length = options.files.length;
for (var i = 0; i < length; i++) {
promises.push(load({
prefix: options.files[i].prefix,
key: options.key,
suffix: options.files[i].suffix
}));
}
$q.all(promises).then(function (data) {
var length = data.length,
mergedData = {};
for (var i = 0; i < length; i++) {
for (var key in data[i]) {
mergedData[key] = data[i][key];
}
}
deferred.resolve(mergedData);
}, function (data) {
deferred.reject(data);
});

@@ -44,0 +86,0 @@

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",["$q","$http",function(a,b){return function(c){if(!c||!angular.isString(c.prefix)||!angular.isString(c.suffix))throw new Error("Couldn't load static files, no prefix or suffix specified!");var d=a.defer();return b(angular.extend({url:[c.prefix,c.key,c.suffix].join(""),method:"GET",params:""},c.$http)).success(function(a){d.resolve(a)}).error(function(){d.reject(c.key)}),d.promise}}]);
angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",["$q","$http",function(a,b){return function(c){if(!(c&&(angular.isArray(c.files)||angular.isString(c.prefix)&&angular.isString(c.suffix))))throw new Error("Couldn't load static files, no files and prefix or suffix specified!");c.files||(c.files=[{prefix:c.prefix,suffix:c.suffix}]);for(var d=function(d){if(!d||!angular.isString(d.prefix)||!angular.isString(d.suffix))throw new Error("Couldn't load static file, no prefix or suffix specified!");var e=a.defer();return b(angular.extend({url:[c.prefix,c.key,c.suffix].join(""),method:"GET",params:""},c.$http)).success(function(a){e.resolve(a)}).error(function(){e.reject(c.key)}),e.promise},e=a.defer(),f=[],g=c.files.length,h=0;g>h;h++)f.push(d({prefix:c.files[h].prefix,key:c.key,suffix:c.files[h].suffix}));return a.all(f).then(function(a){for(var b=a.length,c={},d=0;b>d;d++)for(var f in a[d])c[f]=a[d][f];e.resolve(c)},function(a){e.reject(a)}),e.promise}}]);
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -6,0 +6,0 @@ angular.module('pascalprecht.translate')

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").factory("$translateUrlLoader",["$q","$http",function(a,b){return function(c){if(!c||!c.url)throw new Error("Couldn't use urlLoader since no url is given!");var d=a.defer(),e={};return e[c.queryParameter||"lang"]=c.key,b(angular.extend({url:c.url,params:e,method:"GET"},c.$http)).success(function(a){d.resolve(a)}).error(function(){d.reject(c.key)}),d.promise}}]);
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -6,0 +6,0 @@ angular.module('pascalprecht.translate')

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").factory("$translateCookieStorage",["$cookieStore",function(a){var b={get:function(b){return a.get(b)},set:function(b,c){a.put(b,c)},put:function(b,c){a.put(b,c)}};return b}]);
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/

@@ -12,2 +12,3 @@ angular.module('pascalprecht.translate')

* @requires $window
* @requires $translateCookieStorage
*

@@ -14,0 +15,0 @@ * @description

/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate").factory("$translateLocalStorage",["$window","$translateCookieStorage",function(a,b){var c=function(){var b;return{get:function(c){return b||(b=a.localStorage.getItem(c)),b},set:function(c,d){b=d,a.localStorage.setItem(c,d)},put:function(c,d){b=d,a.localStorage.setItem(c,d)}}}(),d="localStorage"in a;if(d){var e="pascalprecht.translate.storageTest";try{null!==a.localStorage?(a.localStorage.setItem(e,"foo"),a.localStorage.removeItem(e),d=!0):d=!1}catch(f){d=!1}}var g=d?c:b;return g}]);
/*!
* angular-translate - v2.5.2 - 2014-12-10
* angular-translate - v2.6.0 - 2015-02-08
* http://github.com/angular-translate/angular-translate
* Copyright (c) 2014 ; Licensed MIT
* Copyright (c) 2015 ; Licensed MIT
*/
angular.module("pascalprecht.translate",["ng"]).run(["$translate",function(a){var b=a.storageKey(),c=a.storage(),d=function(){var d=a.preferredLanguage();angular.isString(d)?a.use(d):c.put(b,a.use())};c?c.get(b)?a.use(c.get(b))["catch"](d):d():angular.isString(a.preferredLanguage())&&a.use(a.preferredLanguage())}]),angular.module("pascalprecht.translate").provider("$translate",["$STORAGE_KEY",function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q={},r=[],s=a,t=[],u=!1,v="translate-cloak",w=!1,x=".",y="2.5.2",z=function(){var a,b,c=window.navigator,d=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(c.languages))for(a=0;a<c.languages.length;a++)if(b=c.languages[a],b&&b.length)return b;for(a=0;a<d.length;a++)if(b=c[d[a]],b&&b.length)return b;return null};z.displayName="angular-translate/service: getFirstBrowserLanguage";var A=function(){return(z()||"").split("-").join("_")};A.displayName="angular-translate/service: getLocale";var B=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},C=function(){return this.replace(/^\s+|\s+$/g,"")},D=function(a){for(var b=[],d=angular.lowercase(a),e=0,f=r.length;f>e;e++)b.push(angular.lowercase(r[e]));if(B(b,d)>-1)return a;if(c){var g;for(var h in c){var i=!1,j=Object.prototype.hasOwnProperty.call(c,h)&&angular.lowercase(h)===angular.lowercase(a);if("*"===h.slice(-1)&&(i=h.slice(0,-1)===a.slice(0,h.length-1)),(j||i)&&(g=c[h],B(b,angular.lowercase(g))>-1))return g}}var k=a.split("_");return k.length>1&&B(b,angular.lowercase(k[0]))>-1?k[0]:a},E=function(a,b){if(!a&&!b)return q;if(a&&!b){if(angular.isString(a))return q[a]}else angular.isObject(q[a])||(q[a]={}),angular.extend(q[a],F(b));return this};this.translations=E,this.cloakClassName=function(a){return a?(v=a,this):v};var F=function(a,b,c,d){var e,f,g,h;b||(b=[]),c||(c={});for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(h=a[e],angular.isObject(h)?F(h,b.concat(e),c,e):(f=b.length?""+b.join(x)+x+e:e,b.length&&e===d&&(g=""+b.join(x),c[g]="@:"+f),c[f]=h));return c};this.addInterpolation=function(a){return t.push(a),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(a){return k=a,this},this.useSanitizeValueStrategy=function(a){return u=a,this},this.preferredLanguage=function(a){return G(a),this};var G=function(a){return a&&(b=a),b};this.translationNotFoundIndicator=function(a){return this.translationNotFoundIndicatorLeft(a),this.translationNotFoundIndicatorRight(a),this},this.translationNotFoundIndicatorLeft=function(a){return a?(n=a,this):n},this.translationNotFoundIndicatorRight=function(a){return a?(o=a,this):o},this.fallbackLanguage=function(a){return H(a),this};var H=function(a){return a?(angular.isString(a)?(e=!0,d=[a]):angular.isArray(a)&&(e=!1,d=a),angular.isString(b)&&B(d,b)<0&&d.push(b),this):e?d[0]:d};this.use=function(a){if(a){if(!q[a]&&!l)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+a+"'");return f=a,this}return f};var I=function(a){return a?void(s=a):i?i+s:s};this.storageKey=I,this.useUrlLoader=function(a,b){return this.useLoader("$translateUrlLoader",angular.extend({url:a},b))},this.useStaticFilesLoader=function(a){return this.useLoader("$translateStaticFilesLoader",a)},this.useLoader=function(a,b){return l=a,m=b||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(a){return h=a,this},this.storagePrefix=function(a){return a?(i=a,this):a},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(a){return j=a,this},this.usePostCompiling=function(a){return w=!!a,this},this.determinePreferredLanguage=function(a){var c=a&&angular.isFunction(a)?a():A();return b=r.length?D(c):c,this},this.registerAvailableLanguageKeys=function(a,b){return a?(r=a,b&&(c=b),this):r},this.useLoaderCache=function(a){return a===!1?p=void 0:a===!0?p=!0:"undefined"==typeof a?p="$translationCache":a&&(p=a),this},this.$get=["$log","$injector","$rootScope","$q",function(a,c,i,r){var x,z,A,J=c.get(k||"$translateDefaultInterpolation"),K=!1,L={},M={},N=function(a,c,e){if(angular.isArray(a)){var g=function(a){for(var b={},d=[],f=function(a){var d=r.defer(),f=function(c){b[a]=c,d.resolve([a,c])};return N(a,c,e).then(f,f),d.promise},g=0,h=a.length;h>g;g++)d.push(f(a[g]));return r.all(d).then(function(){return b})};return g(a)}var i=r.defer();a&&(a=C.apply(a));var j=function(){var a=b?M[b]:M[f];if(z=0,h&&!a){var c=x.get(s);if(a=M[c],d&&d.length){var e=B(d,c);z=0===e?1:0,B(d,b)<0&&d.push(b)}}return a}();return j?j.then(function(){Z(a,c,e).then(i.resolve,i.reject)},i.reject):Z(a,c,e).then(i.resolve,i.reject),i.promise},O=function(a){return n&&(a=[n,a].join(" ")),o&&(a=[a,o].join(" ")),a},P=function(a){f=a,i.$emit("$translateChangeSuccess",{language:a}),h&&x.put(N.storageKey(),f),J.setLocale(f),angular.forEach(L,function(a,b){L[b].setLocale(f)}),i.$emit("$translateChangeEnd",{language:a})},Q=function(a){if(!a)throw"No language key specified for loading.";var b=r.defer();i.$emit("$translateLoadingStart",{language:a}),K=!0;var d=p;"string"==typeof d&&(d=c.get(d));var e=angular.extend({},m,{key:a,$http:angular.extend({},{cache:d},m.$http)});return c.get(l)(e).then(function(c){var d={};i.$emit("$translateLoadingSuccess",{language:a}),angular.isArray(c)?angular.forEach(c,function(a){angular.extend(d,F(a))}):angular.extend(d,F(c)),K=!1,b.resolve({key:a,table:d}),i.$emit("$translateLoadingEnd",{language:a})},function(a){i.$emit("$translateLoadingError",{language:a}),b.reject(a),i.$emit("$translateLoadingEnd",{language:a})}),b.promise};if(h&&(x=c.get(h),!x.get||!x.put))throw new Error("Couldn't use storage '"+h+"', missing get() or put() method!");angular.isFunction(J.useSanitizeValueStrategy)&&J.useSanitizeValueStrategy(u),t.length&&angular.forEach(t,function(a){var d=c.get(a);d.setLocale(b||f),angular.isFunction(d.useSanitizeValueStrategy)&&d.useSanitizeValueStrategy(u),L[d.getInterpolationIdentifier()]=d});var R=function(a){var b=r.defer();return Object.prototype.hasOwnProperty.call(q,a)?b.resolve(q[a]):M[a]?M[a].then(function(a){E(a.key,a.table),b.resolve(a.table)},b.reject):b.reject(),b.promise},S=function(a,b,c,d){var e=r.defer();return R(a).then(function(g){Object.prototype.hasOwnProperty.call(g,b)?(d.setLocale(a),e.resolve(d.interpolate(g[b],c)),d.setLocale(f)):e.reject()},e.reject),e.promise},T=function(a,b,c,d){var e,g=q[a];return g&&Object.prototype.hasOwnProperty.call(g,b)&&(d.setLocale(a),e=d.interpolate(g[b],c),d.setLocale(f)),e},U=function(a){if(j){var b=c.get(j)(a,f);return void 0!==b?b:a}return a},V=function(a,b,c,e){var f=r.defer();if(a<d.length){var g=d[a];S(g,b,c,e).then(f.resolve,function(){V(a+1,b,c,e).then(f.resolve)})}else f.resolve(U(b));return f.promise},W=function(a,b,c,e){var f;if(a<d.length){var g=d[a];f=T(g,b,c,e),f||(f=W(a+1,b,c,e))}return f},X=function(a,b,c){return V(A>0?A:z,a,b,c)},Y=function(a,b,c){return W(A>0?A:z,a,b,c)},Z=function(a,b,c){var e=r.defer(),g=f?q[f]:q,h=c?L[c]:J;if(g&&Object.prototype.hasOwnProperty.call(g,a)){var i=g[a];"@:"===i.substr(0,2)?N(i.substr(2),b,c).then(e.resolve,e.reject):e.resolve(h.interpolate(i,b))}else{var k;j&&!K&&(k=U(a)),f&&d&&d.length?X(a,b,h).then(function(a){e.resolve(a)},function(a){e.reject(O(a))}):j&&!K&&k?e.resolve(k):e.reject(O(a))}return e.promise},$=function(a,b,c){var e,g=f?q[f]:q,h=c?L[c]:J;if(g&&Object.prototype.hasOwnProperty.call(g,a)){var i=g[a];e="@:"===i.substr(0,2)?$(i.substr(2),b,c):h.interpolate(i,b)}else{var k;j&&!K&&(k=U(a)),f&&d&&d.length?(z=0,e=Y(a,b,h)):e=j&&!K&&k?k:O(a)}return e};if(N.preferredLanguage=function(a){return a&&G(a),b},N.cloakClassName=function(){return v},N.fallbackLanguage=function(a){if(void 0!==a&&null!==a){if(H(a),l&&d&&d.length)for(var b=0,c=d.length;c>b;b++)M[d[b]]||(M[d[b]]=Q(d[b]));N.use(N.use())}return e?d[0]:d},N.useFallbackLanguage=function(a){if(void 0!==a&&null!==a)if(a){var b=B(d,a);b>-1&&(A=b)}else A=0},N.proposedLanguage=function(){return g},N.storage=function(){return x},N.use=function(a){if(!a)return f;var b=r.defer();i.$emit("$translateChangeStart",{language:a});var c=D(a);return c&&(a=c),q[a]||!l||M[a]?(b.resolve(a),P(a)):(g=a,M[a]=Q(a).then(function(c){return E(c.key,c.table),b.resolve(c.key),P(c.key),g===a&&(g=void 0),c},function(a){g===a&&(g=void 0),i.$emit("$translateChangeError",{language:a}),b.reject(a),i.$emit("$translateChangeEnd",{language:a})})),b.promise},N.storageKey=function(){return I()},N.isPostCompilingEnabled=function(){return w},N.refresh=function(a){function b(){e.resolve(),i.$emit("$translateRefreshEnd",{language:a})}function c(){e.reject(),i.$emit("$translateRefreshEnd",{language:a})}if(!l)throw new Error("Couldn't refresh translation table, no loader registered!");var e=r.defer();if(i.$emit("$translateRefreshStart",{language:a}),a)q[a]?Q(a).then(function(c){E(c.key,c.table),a===f&&P(f),b()},c):c();else{var g=[],h={};if(d&&d.length)for(var j=0,k=d.length;k>j;j++)g.push(Q(d[j])),h[d[j]]=!0;f&&!h[f]&&g.push(Q(f)),r.all(g).then(function(a){angular.forEach(a,function(a){q[a.key]&&delete q[a.key],E(a.key,a.table)}),f&&P(f),b()})}return e.promise},N.instant=function(a,c,e){if(null===a||angular.isUndefined(a))return a;if(angular.isArray(a)){for(var g={},h=0,i=a.length;i>h;h++)g[a[h]]=N.instant(a[h],c,e);return g}if(angular.isString(a)&&a.length<1)return a;a&&(a=C.apply(a));var k,l=[];b&&l.push(b),f&&l.push(f),d&&d.length&&(l=l.concat(d));for(var m=0,n=l.length;n>m;m++){var o=l[m];if(q[o]&&"undefined"!=typeof q[o][a]&&(k=$(a,c,e)),"undefined"!=typeof k)break}return k||""===k||(k=J.interpolate(a,c),j&&!K&&(k=U(a))),k},N.versionInfo=function(){return y},N.loaderCache=function(){return p},l&&(angular.equals(q,{})&&N.use(N.use()),d&&d.length))for(var _=function(a){return E(a.key,a.table),i.$emit("$translateChangeEnd",{language:a.key}),a},ab=0,bb=d.length;bb>ab;ab++)M[d[ab]]=Q(d[ab]).then(_);return N}]}]),angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",["$interpolate",function(a){var b,c={},d="default",e=null,f={escaped:function(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=angular.element("<div></div>").text(a[c]).html());return b}},g=function(a){var b;return b=angular.isFunction(f[e])?f[e](a):a};return c.setLocale=function(a){b=a},c.getInterpolationIdentifier=function(){return d},c.useSanitizeValueStrategy=function(a){return e=a,this},c.interpolate=function(b,c){return e&&(c=g(c)),a(b)(c||{})},c}]),angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",["$translate","$q","$interpolate","$compile","$parse","$rootScope",function(a,b,c,d,e,f){return{restrict:"AE",scope:!0,compile:function(b,g){var h=g.translateValues?g.translateValues:void 0,i=g.translateInterpolation?g.translateInterpolation:void 0,j=b[0].outerHTML.match(/translate-value-+/i),k="^(.*)("+c.startSymbol()+".*"+c.endSymbol()+")(.*)",l="^(.*)"+c.startSymbol()+"(.*)"+c.endSymbol()+"(.*)";return function(b,m,n){b.interpolateParams={},b.preText="",b.postText="";var o={},p=function(a){if(angular.equals(a,"")||!angular.isDefined(a)){var d=m.text().match(k);angular.isArray(d)?(b.preText=d[1],b.postText=d[3],o.translate=c(d[2])(b.$parent),watcherMatches=m.text().match(l),angular.isArray(watcherMatches)&&watcherMatches[2]&&watcherMatches[2].length&&b.$watch(watcherMatches[2],function(a){o.translate=a,u()})):o.translate=m.text().replace(/^\s+|\s+$/g,"")}else o.translate=a;u()},q=function(a){n.$observe(a,function(b){o[a]=b,u()})};n.$observe("translate",function(a){p(a)});for(var r in n)n.hasOwnProperty(r)&&"translateAttr"===r.substr(0,13)&&q(r);if(n.$observe("translateDefault",function(a){b.defaultText=a}),h&&n.$observe("translateValues",function(a){a&&b.$parent.$watch(function(){angular.extend(b.interpolateParams,e(a)(b.$parent))})}),j){var s=function(a){n.$observe(a,function(c){var d=angular.lowercase(a.substr(14,1))+a.substr(15);b.interpolateParams[d]=c})};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&"translateValue"===t.substr(0,14)&&"translateValues"!==t&&s(t)}var u=function(){for(var a in o)o.hasOwnProperty(a)&&o[a]&&v(a,o[a],b,b.interpolateParams)},v=function(b,c,d,e){a(c,e,i).then(function(a){w(a,d,!0,b)},function(a){w(a,d,!1,b)})},w=function(b,c,e,f){if("translate"===f){e||"undefined"==typeof c.defaultText||(b=c.defaultText),m.html(c.preText+b+c.postText);var h=a.isPostCompilingEnabled(),i="undefined"!=typeof g.translateCompile,j=i&&"false"!==g.translateCompile;(h&&!i||j)&&d(m.contents())(c)}else{e||"undefined"==typeof c.defaultText||(b=c.defaultText);var k=n.$attr[f].substr(15);m.attr(k,b)}};b.$watch("interpolateParams",u,!0);var x=f.$on("$translateChangeSuccess",u);m.text().length&&p(""),u(),b.$on("$destroy",x)}}}}]),angular.module("pascalprecht.translate").directive("translateCloak",["$rootScope","$translate",function(a,b){return{compile:function(c){var d=function(){c.addClass(b.cloakClassName())},e=function(){c.removeClass(b.cloakClassName())},f=a.$on("$translateChangeEnd",function(){e(),f(),f=null});return d(),function(a,c,f){f.translateCloak&&f.translateCloak.length&&f.$observe("translateCloak",function(a){b(a).then(e,d)})}}}}]),angular.module("pascalprecht.translate").filter("translate",["$parse","$translate",function(a,b){var c=function(c,d,e){return angular.isObject(d)||(d=a(d)(this)),b.instant(c,d,e)};return c.$stateful=!0,c}]);
angular.module("pascalprecht.translate",["ng"]).run(["$translate",function(a){var b=a.storageKey(),c=a.storage(),d=function(){var d=a.preferredLanguage();angular.isString(d)?a.use(d):c.put(b,a.use())};c?c.get(b)?a.use(c.get(b))["catch"](d):d():angular.isString(a.preferredLanguage())&&a.use(a.preferredLanguage())}]),angular.module("pascalprecht.translate").provider("$translate",["$STORAGE_KEY","$windowProvider",function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r={},s=[],t=a,u=[],v=!1,w="translate-cloak",x=!1,y=".",z=0,A="2.6.0",B=function(){var a,c,d=b.$get().navigator,e=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(d.languages))for(a=0;a<d.languages.length;a++)if(c=d.languages[a],c&&c.length)return c;for(a=0;a<e.length;a++)if(c=d[e[a]],c&&c.length)return c;return null};B.displayName="angular-translate/service: getFirstBrowserLanguage";var C=function(){return(B()||"").split("-").join("_")};C.displayName="angular-translate/service: getLocale";var D=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},E=function(){return this.replace(/^\s+|\s+$/g,"")},F=function(a){for(var b=[],c=angular.lowercase(a),e=0,f=s.length;f>e;e++)b.push(angular.lowercase(s[e]));if(D(b,c)>-1)return a;if(d){var g;for(var h in d){var i=!1,j=Object.prototype.hasOwnProperty.call(d,h)&&angular.lowercase(h)===angular.lowercase(a);if("*"===h.slice(-1)&&(i=h.slice(0,-1)===a.slice(0,h.length-1)),(j||i)&&(g=d[h],D(b,angular.lowercase(g))>-1))return g}}var k=a.split("_");return k.length>1&&D(b,angular.lowercase(k[0]))>-1?k[0]:a},G=function(a,b){if(!a&&!b)return r;if(a&&!b){if(angular.isString(a))return r[a]}else angular.isObject(r[a])||(r[a]={}),angular.extend(r[a],H(b));return this};this.translations=G,this.cloakClassName=function(a){return a?(w=a,this):w};var H=function(a,b,c,d){var e,f,g,h;b||(b=[]),c||(c={});for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(h=a[e],angular.isObject(h)?H(h,b.concat(e),c,e):(f=b.length?""+b.join(y)+y+e:e,b.length&&e===d&&(g=""+b.join(y),c[g]="@:"+f),c[f]=h));return c};this.addInterpolation=function(a){return u.push(a),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(a){return l=a,this},this.useSanitizeValueStrategy=function(a){return v=a,this},this.preferredLanguage=function(a){return I(a),this};var I=function(a){return a&&(c=a),c};this.translationNotFoundIndicator=function(a){return this.translationNotFoundIndicatorLeft(a),this.translationNotFoundIndicatorRight(a),this},this.translationNotFoundIndicatorLeft=function(a){return a?(o=a,this):o},this.translationNotFoundIndicatorRight=function(a){return a?(p=a,this):p},this.fallbackLanguage=function(a){return J(a),this};var J=function(a){return a?(angular.isString(a)?(f=!0,e=[a]):angular.isArray(a)&&(f=!1,e=a),angular.isString(c)&&D(e,c)<0&&e.push(c),this):f?e[0]:e};this.use=function(a){if(a){if(!r[a]&&!m)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+a+"'");return g=a,this}return g};var K=function(a){return a?void(t=a):j?j+t:t};this.storageKey=K,this.useUrlLoader=function(a,b){return this.useLoader("$translateUrlLoader",angular.extend({url:a},b))},this.useStaticFilesLoader=function(a){return this.useLoader("$translateStaticFilesLoader",a)},this.useLoader=function(a,b){return m=a,n=b||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(a){return i=a,this},this.storagePrefix=function(a){return a?(j=a,this):a},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(a){return k=a,this},this.usePostCompiling=function(a){return x=!!a,this},this.determinePreferredLanguage=function(a){var b=a&&angular.isFunction(a)?a():C();return c=s.length?F(b):b,this},this.registerAvailableLanguageKeys=function(a,b){return a?(s=a,b&&(d=b),this):s},this.useLoaderCache=function(a){return a===!1?q=void 0:a===!0?q=!0:"undefined"==typeof a?q="$translationCache":a&&(q=a),this},this.directivePriority=function(a){return void 0===a?z:(z=a,this)},this.$get=["$log","$injector","$rootScope","$q",function(a,b,d,j){var s,y,B,C=b.get(l||"$translateDefaultInterpolation"),L=!1,M={},N={},O=function(a,b,d,f){if(angular.isArray(a)){var h=function(a){for(var c={},e=[],g=function(a){var e=j.defer(),g=function(b){c[a]=b,e.resolve([a,b])};return O(a,b,d,f).then(g,g),e.promise},h=0,i=a.length;i>h;h++)e.push(g(a[h]));return j.all(e).then(function(){return c})};return h(a)}var k=j.defer();a&&(a=E.apply(a));var l=function(){var a=c?N[c]:N[g];if(y=0,i&&!a){var b=s.get(t);if(a=N[b],e&&e.length){var d=D(e,b);y=0===d?1:0,D(e,c)<0&&e.push(c)}}return a}();return l?l.then(function(){$(a,b,d,f).then(k.resolve,k.reject)},k.reject):$(a,b,d,f).then(k.resolve,k.reject),k.promise},P=function(a){return o&&(a=[o,a].join(" ")),p&&(a=[a,p].join(" ")),a},Q=function(a){g=a,d.$emit("$translateChangeSuccess",{language:a}),i&&s.put(O.storageKey(),g),C.setLocale(g),angular.forEach(M,function(a,b){M[b].setLocale(g)}),d.$emit("$translateChangeEnd",{language:a})},R=function(a){if(!a)throw"No language key specified for loading.";var c=j.defer();d.$emit("$translateLoadingStart",{language:a}),L=!0;var e=q;"string"==typeof e&&(e=b.get(e));var f=angular.extend({},n,{key:a,$http:angular.extend({},{cache:e},n.$http)});return b.get(m)(f).then(function(b){var e={};d.$emit("$translateLoadingSuccess",{language:a}),angular.isArray(b)?angular.forEach(b,function(a){angular.extend(e,H(a))}):angular.extend(e,H(b)),L=!1,c.resolve({key:a,table:e}),d.$emit("$translateLoadingEnd",{language:a})},function(a){d.$emit("$translateLoadingError",{language:a}),c.reject(a),d.$emit("$translateLoadingEnd",{language:a})}),c.promise};if(i&&(s=b.get(i),!s.get||!s.put))throw new Error("Couldn't use storage '"+i+"', missing get() or put() method!");angular.isFunction(C.useSanitizeValueStrategy)&&C.useSanitizeValueStrategy(v),u.length&&angular.forEach(u,function(a){var d=b.get(a);d.setLocale(c||g),angular.isFunction(d.useSanitizeValueStrategy)&&d.useSanitizeValueStrategy(v),M[d.getInterpolationIdentifier()]=d});var S=function(a){var b=j.defer();return Object.prototype.hasOwnProperty.call(r,a)?b.resolve(r[a]):N[a]?N[a].then(function(a){G(a.key,a.table),b.resolve(a.table)},b.reject):b.reject(),b.promise},T=function(a,b,c,d){var e=j.defer();return S(a).then(function(f){if(Object.prototype.hasOwnProperty.call(f,b)){d.setLocale(a);var h=f[b];"@:"===h.substr(0,2)?T(a,h.substr(2),c,d).then(e.resolve,e.reject):e.resolve(d.interpolate(f[b],c)),d.setLocale(g)}else e.reject()},e.reject),e.promise},U=function(a,b,c,d){var e,f=r[a];if(f&&Object.prototype.hasOwnProperty.call(f,b)){if(d.setLocale(a),e=d.interpolate(f[b],c),"@:"===e.substr(0,2))return U(a,e.substr(2),c,d);d.setLocale(g)}return e},V=function(a){if(k){var c=b.get(k)(a,g);return void 0!==c?c:a}return a},W=function(a,b,c,d,f){var g=j.defer();if(a<e.length){var h=e[a];T(h,b,c,d).then(g.resolve,function(){W(a+1,b,c,d,f).then(g.resolve)})}else g.resolve(f?f:V(b));return g.promise},X=function(a,b,c,d){var f;if(a<e.length){var g=e[a];f=U(g,b,c,d),f||(f=X(a+1,b,c,d))}return f},Y=function(a,b,c,d){return W(B>0?B:y,a,b,c,d)},Z=function(a,b,c){return X(B>0?B:y,a,b,c)},$=function(a,b,c,d){var f=j.defer(),h=g?r[g]:r,i=c?M[c]:C;if(h&&Object.prototype.hasOwnProperty.call(h,a)){var l=h[a];"@:"===l.substr(0,2)?O(l.substr(2),b,c,d).then(f.resolve,f.reject):f.resolve(i.interpolate(l,b))}else{var m;k&&!L&&(m=V(a)),g&&e&&e.length?Y(a,b,i,d).then(function(a){f.resolve(a)},function(a){f.reject(P(a))}):k&&!L&&m?f.resolve(d?d:m):d?f.resolve(d):f.reject(P(a))}return f.promise},_=function(a,b,c){var d,f=g?r[g]:r,h=c?M[c]:C;if(f&&Object.prototype.hasOwnProperty.call(f,a)){var i=f[a];d="@:"===i.substr(0,2)?_(i.substr(2),b,c):h.interpolate(i,b)}else{var j;k&&!L&&(j=V(a)),g&&e&&e.length?(y=0,d=Z(a,b,h)):d=k&&!L&&j?j:P(a)}return d};if(O.preferredLanguage=function(a){return a&&I(a),c},O.cloakClassName=function(){return w},O.fallbackLanguage=function(a){if(void 0!==a&&null!==a){if(J(a),m&&e&&e.length)for(var b=0,c=e.length;c>b;b++)N[e[b]]||(N[e[b]]=R(e[b]));O.use(O.use())}return f?e[0]:e},O.useFallbackLanguage=function(a){if(void 0!==a&&null!==a)if(a){var b=D(e,a);b>-1&&(B=b)}else B=0},O.proposedLanguage=function(){return h},O.storage=function(){return s},O.use=function(a){if(!a)return g;var b=j.defer();d.$emit("$translateChangeStart",{language:a});var c=F(a);return c&&(a=c),r[a]||!m||N[a]?(b.resolve(a),Q(a)):(h=a,N[a]=R(a).then(function(c){return G(c.key,c.table),b.resolve(c.key),Q(c.key),h===a&&(h=void 0),c},function(a){h===a&&(h=void 0),d.$emit("$translateChangeError",{language:a}),b.reject(a),d.$emit("$translateChangeEnd",{language:a})})),b.promise},O.storageKey=function(){return K()},O.isPostCompilingEnabled=function(){return x},O.refresh=function(a){function b(){f.resolve(),d.$emit("$translateRefreshEnd",{language:a})}function c(){f.reject(),d.$emit("$translateRefreshEnd",{language:a})}if(!m)throw new Error("Couldn't refresh translation table, no loader registered!");var f=j.defer();if(d.$emit("$translateRefreshStart",{language:a}),a)r[a]?R(a).then(function(c){G(c.key,c.table),a===g&&Q(g),b()},c):c();else{var h=[],i={};if(e&&e.length)for(var k=0,l=e.length;l>k;k++)h.push(R(e[k])),i[e[k]]=!0;g&&!i[g]&&h.push(R(g)),j.all(h).then(function(a){angular.forEach(a,function(a){r[a.key]&&delete r[a.key],G(a.key,a.table)}),g&&Q(g),b()})}return f.promise},O.instant=function(a,b,d){if(null===a||angular.isUndefined(a))return a;if(angular.isArray(a)){for(var f={},h=0,i=a.length;i>h;h++)f[a[h]]=O.instant(a[h],b,d);return f}if(angular.isString(a)&&a.length<1)return a;a&&(a=E.apply(a));var j,l=[];c&&l.push(c),g&&l.push(g),e&&e.length&&(l=l.concat(e));for(var m=0,n=l.length;n>m;m++){var q=l[m];if(r[q]&&("undefined"!=typeof r[q][a]?j=_(a,b,d):(o||p)&&(j=P(a))),"undefined"!=typeof j)break}return j||""===j||(j=C.interpolate(a,b),k&&!L&&(j=V(a))),j},O.versionInfo=function(){return A},O.loaderCache=function(){return q},O.directivePriority=function(){return z},m&&(angular.equals(r,{})&&O.use(O.use()),e&&e.length))for(var ab=function(a){return G(a.key,a.table),d.$emit("$translateChangeEnd",{language:a.key}),a},bb=0,cb=e.length;cb>bb;bb++)N[e[bb]]=R(e[bb]).then(ab);return O}]}]),angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",["$interpolate",function(a){var b,c={},d="default",e=null,f={escaped:function(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=angular.isNumber(a[c])?a[c]:angular.element("<div></div>").text(a[c]).html());return b}},g=function(a){var b;return b=angular.isFunction(f[e])?f[e](a):a};return c.setLocale=function(a){b=a},c.getInterpolationIdentifier=function(){return d},c.useSanitizeValueStrategy=function(a){return e=a,this},c.interpolate=function(b,c){return e&&(c=g(c)),a(b)(c||{})},c}]),angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",["$translate","$q","$interpolate","$compile","$parse","$rootScope",function(a,b,c,d,e,f){var g=function(){return this.replace(/^\s+|\s+$/g,"")};return{restrict:"AE",scope:!0,priority:a.directivePriority(),compile:function(b,h){var i=h.translateValues?h.translateValues:void 0,j=h.translateInterpolation?h.translateInterpolation:void 0,k=b[0].outerHTML.match(/translate-value-+/i),l="^(.*)("+c.startSymbol()+".*"+c.endSymbol()+")(.*)",m="^(.*)"+c.startSymbol()+"(.*)"+c.endSymbol()+"(.*)";return function(b,n,o){b.interpolateParams={},b.preText="",b.postText="";var p={},q=function(a){if(angular.isFunction(q._unwatchOld)&&(q._unwatchOld(),q._unwatchOld=void 0),angular.equals(a,"")||!angular.isDefined(a)){var d=g.apply(n.text()).match(l);if(angular.isArray(d)){b.preText=d[1],b.postText=d[3],p.translate=c(d[2])(b.$parent);var e=n.text().match(m);angular.isArray(e)&&e[2]&&e[2].length&&(q._unwatchOld=b.$watch(e[2],function(a){p.translate=a,w()}))}else p.translate=n.text().replace(/^\s+|\s+$/g,"")}else p.translate=a;w()},r=function(a){o.$observe(a,function(b){p[a]=b,w()})},s=!0;o.$observe("translate",function(a){"undefined"==typeof a?q(""):""===a&&s||(p.translate=a,w()),s=!1});for(var t in o)o.hasOwnProperty(t)&&"translateAttr"===t.substr(0,13)&&r(t);if(o.$observe("translateDefault",function(a){b.defaultText=a}),i&&o.$observe("translateValues",function(a){a&&b.$parent.$watch(function(){angular.extend(b.interpolateParams,e(a)(b.$parent))})}),k){var u=function(a){o.$observe(a,function(c){var d=angular.lowercase(a.substr(14,1))+a.substr(15);b.interpolateParams[d]=c})};for(var v in o)Object.prototype.hasOwnProperty.call(o,v)&&"translateValue"===v.substr(0,14)&&"translateValues"!==v&&u(v)}var w=function(){for(var a in p)p.hasOwnProperty(a)&&x(a,p[a],b,b.interpolateParams,b.defaultText)},x=function(b,c,d,e,f){c?a(c,e,j,f).then(function(a){y(a,d,!0,b)},function(a){y(a,d,!1,b)}):y(c,d,!1,b)},y=function(b,c,e,f){if("translate"===f){e||"undefined"==typeof c.defaultText||(b=c.defaultText),n.html(c.preText+b+c.postText);var g=a.isPostCompilingEnabled(),i="undefined"!=typeof h.translateCompile,j=i&&"false"!==h.translateCompile;(g&&!i||j)&&d(n.contents())(c)}else{e||"undefined"==typeof c.defaultText||(b=c.defaultText);var k=o.$attr[f].substr(15);n.attr(k,b)}};b.$watch("interpolateParams",w,!0);var z=f.$on("$translateChangeSuccess",w);n.text().length&&q(""),w(),b.$on("$destroy",z)}}}}]),angular.module("pascalprecht.translate").directive("translateCloak",["$rootScope","$translate",function(a,b){return{compile:function(c){var d=function(){c.addClass(b.cloakClassName())},e=function(){c.removeClass(b.cloakClassName())},f=a.$on("$translateChangeEnd",function(){e(),f(),f=null});return d(),function(a,c,f){f.translateCloak&&f.translateCloak.length&&f.$observe("translateCloak",function(a){b(a).then(e,d)})}}}}]),angular.module("pascalprecht.translate").filter("translate",["$parse","$translate",function(a,b){var c=function(c,d,e){return angular.isObject(d)||(d=a(d)(this)),b.instant(c,d,e)};return c.$stateful=!0,c}]);
{
"name": "angular-translate",
"version": "2.5.2",
"version": "2.6.0",
"description": "A translation module for AngularJS",

@@ -5,0 +5,0 @@ "main": "dist/angular-translate.js",

# [![angular-translate](https://raw.github.com/angular-translate/angular-translate/canary/identity/logo/angular-translate-alternative/angular-translate_alternative_medium2.png)](http://angular-translate.github.io)
![Bower](https://img.shields.io/bower/v/angular-translate.svg) [![NPM](https://img.shields.io/npm/v/angular-translate.svg)](https://www.npmjs.com/package/angular-translate) [![Build Status](https://img.shields.io/travis/angular-translate/angular-translate.svg)](https://travis-ci.org/angular-translate/angular-translate) ![License](https://img.shields.io/npm/l/angular-translate.svg) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
![Bower](https://img.shields.io/bower/v/angular-translate.svg) [![NPM](https://img.shields.io/npm/v/angular-translate.svg)](https://www.npmjs.com/package/angular-translate) [![Build Status](https://img.shields.io/travis/angular-translate/angular-translate.svg)](https://travis-ci.org/angular-translate/angular-translate) ![License](https://img.shields.io/npm/l/angular-translate.svg) ![Code Climate](https://img.shields.io/codeclimate/github/angular-translate/angular-translate.svg) ![Code Coverage](https://img.shields.io/codeclimate/coverage/github/angular-translate/angular-translate.svg)

@@ -56,8 +56,6 @@

The *unit tests* are available with `npm test`. It performs tests under the current primary target version of AngularJS and other scoped versions as well. Under the hood, this calls `grunt test` for the primary target and for each scope.
The *unit tests* are available with `npm test` which is actually a shortcut for `grunt test`. It performs tests under the current primary target version of AngularJS. Use `npm run-script test-scopes` for testing other scoped versions as well.
Testing only the primary target AngularJS version, simply invoke `grunt test`.
## License
Licensed under MIT.

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc