StringResources.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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: Storytelling
  6. * (C) Copyright IBM Corp. 2017, 2019
  7. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['i18n!./CAStorytellingResources', 'polyglot'], function (storytellingResources, Polyglot) {
  10. var poly = new Polyglot({
  11. phrases: storytellingResources,
  12. allowMissing: true
  13. });
  14. var StringResources = function () {
  15. function StringResources() {
  16. _classCallCheck(this, StringResources);
  17. }
  18. /**
  19. * @param {String} key The key of the string to return
  20. * @param {Object} [interpolationOptions] interpolation options (see poly.t documentation for details)
  21. * @returns {String} The string to display
  22. */
  23. StringResources.prototype.get = function get(key, interpolationOptions) {
  24. return poly.t(key, interpolationOptions);
  25. };
  26. return StringResources;
  27. }();
  28. return new StringResources();
  29. });
  30. //# sourceMappingURL=StringResources.js.map