StringResource.js 1009 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. IBM Confidential
  3. OCO Source Materials
  4. IBM Cognos Products: authoring
  5. (C) Copyright IBM Corp. 2015, 2015
  6. The source code for this program is not published or otherwise divested
  7. of its trade secrets, irrespective of what has been deposited with the
  8. U.S. Copyright Office.
  9. */
  10. define(['i18n!bi/classicviewer/nls/ClassicViewerMessages', 'bi/glass/utils/Lexicon'], function(localeResources, Lexicon) {
  11. 'use strict';
  12. var lexicon = new Lexicon( {data : localeResources, verbose : true} );
  13. var StringResources = function() {
  14. return undefined;
  15. };
  16. /**
  17. * Get the string resource for the given key and interpolation options
  18. *
  19. * @param key The key of the string to return
  20. * @param interpolationOptions Optional interpolation options (see poly.t documentation for details)
  21. * @returns The string to display
  22. */
  23. StringResources.prototype.get = function(key, interpolationOptions) {
  24. return lexicon.translate(key, interpolationOptions);
  25. };
  26. return new StringResources();
  27. });