mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Canvas] Expose i18n to Canvas runtime (#27718)
Committing. If there comes a case where the bundled i18n doesn't suffice, we'll cross that bridge when we arrive.
This commit is contained in:
parent
1b2a5861b4
commit
59353daedf
3 changed files with 6 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
"kbn:watch": "node scripts/build --dev --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/i18n": "1.0.0",
|
||||
"lodash": "npm:@elastic/lodash@3.10.1-kibana1",
|
||||
"lodash.clone": "^4.5.0",
|
||||
"scriptjs": "^2.5.8",
|
||||
|
@ -35,4 +36,4 @@
|
|||
"webpack": "4.23.1",
|
||||
"webpack-cli": "^3.1.2"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import $script from 'scriptjs';
|
||||
|
||||
let resolvePromise = null;
|
||||
|
@ -43,6 +44,7 @@ const loadBrowserRegistries = (registries, basePath) => {
|
|||
const type = remainingTypes.pop();
|
||||
window.canvas = window.canvas || {};
|
||||
window.canvas.register = d => registries[type].register(d);
|
||||
window.canvas.i18n = i18n;
|
||||
|
||||
// Load plugins one at a time because each needs a different loader function
|
||||
// $script will only load each of these once, we so can call this as many times as we need?
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { typesRegistry } from '../common/lib/types_registry';
|
||||
import { functionsRegistry as serverFunctions } from '../common/lib/functions_registry';
|
||||
import { getPluginPaths } from './get_plugin_paths';
|
||||
|
@ -53,6 +54,7 @@ export const populateServerRegistries = types => {
|
|||
getPluginPaths(type).then(paths => {
|
||||
global.canvas = global.canvas || {};
|
||||
global.canvas.register = d => registries[type].register(d);
|
||||
global.canvas.i18n = i18n;
|
||||
|
||||
paths.forEach(path => {
|
||||
require(path); // eslint-disable-line import/no-dynamic-require
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue