StringResources.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Cognos Products: Dashboard
  6. * (C) Copyright IBM Corp. 2019
  7. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['i18n!./ServiceabilityResources', 'polyglot'], function (serviceabilityResources, Polyglot) {
  10. var poly = new Polyglot({
  11. phrases: serviceabilityResources,
  12. allowMissing: true
  13. });
  14. var StringResources = function () {
  15. function StringResources() {
  16. _classCallCheck(this, StringResources);
  17. }
  18. /**
  19. * Get the string resource for the given key and interpolation options
  20. *
  21. * @param {string} key The key of the string to return
  22. * @param {object} [interpolationOptions] see poly.t documentation for details
  23. * @returns {string} The corresponding string for the given key
  24. */
  25. StringResources.prototype.get = function get(key, interpolationOptions) {
  26. return poly.t(key, interpolationOptions);
  27. };
  28. return StringResources;
  29. }();
  30. return new StringResources();
  31. });
  32. //# sourceMappingURL=StringResources.js.map