/** * Licensed Materials - Property of IBM * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ import resources from 'amdi18n-loader!./NotebookResources'; const Polyglot = require('polyglot'); class StringResources { constructor() { /** * Module which provides simple access to string resources. */ this.polyglot = new Polyglot({ phrases: resources }); } /** * Get the string resource for the given key and interpolation options * * @param key The key of the string to return * @param interpolationOptions Optional interpolation options (see poly.t documentation for details) * @returns The string to display */ get(key, interpolationOptions) { return this.polyglot.t(key, interpolationOptions); } } export default new StringResources();