angular-translate-handler-log.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. * angular-translate - v2.11.0 - 2016-03-20
  3. *
  4. * Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT
  5. */
  6. (function (root, factory) {
  7. if (typeof define === 'function' && define.amd) {
  8. // AMD. Register as an anonymous module unless amdModuleId is set
  9. define([], function () {
  10. return (factory());
  11. });
  12. } else if (typeof exports === 'object') {
  13. // Node. Does not work with strict CommonJS, but
  14. // only CommonJS-like environments that support module.exports,
  15. // like Node.
  16. module.exports = factory();
  17. } else {
  18. factory();
  19. }
  20. }(this, function () {
  21. $translateMissingTranslationHandlerLog.$inject = ['$log'];
  22. angular.module('pascalprecht.translate')
  23. /**
  24. * @ngdoc object
  25. * @name pascalprecht.translate.$translateMissingTranslationHandlerLog
  26. * @requires $log
  27. *
  28. * @description
  29. * Uses angular's `$log` service to give a warning when trying to translate a
  30. * translation id which doesn't exist.
  31. *
  32. * @returns {function} Handler function
  33. */
  34. .factory('$translateMissingTranslationHandlerLog', $translateMissingTranslationHandlerLog);
  35. function $translateMissingTranslationHandlerLog ($log) {
  36. 'use strict';
  37. return function (translationId) {
  38. $log.warn('Translation for ' + translationId + ' doesn\'t exist');
  39. };
  40. }
  41. $translateMissingTranslationHandlerLog.displayName = '$translateMissingTranslationHandlerLog';
  42. return 'pascalprecht.translate';
  43. }));