1234567891011121314151617181920212223242526272829303132 |
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Modeling UI (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define([
- 'i18n!./nls/ModellerResources', 'polyglot'
- ], function(resources, Polyglot) {
- var StringResourcesBridge = function() {
- 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
- */
- StringResourcesBridge.prototype.get = function(key, interpolationOptions) {
- var translated = this._polyglot.t(key, interpolationOptions);
- if (this._polyglot.phrases[key] === undefined) {
- translated = "__NOT_TRANSLATED__(" + key + ")";
- }
- return translated;
- };
- return new StringResourcesBridge();
- });
|