mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Add @kbn/i18n to @kbn/ui-shared-deps (#55891)
* Add @kbn/i18n to @kbn/ui-shared-deps * Use string DI syntax for i18n angular modules
This commit is contained in:
parent
1bb59af44a
commit
703a3c22da
5 changed files with 17 additions and 2 deletions
|
@ -30,7 +30,13 @@ interface I18nScope extends IScope {
|
|||
const HTML_KEY_PREFIX = 'html_';
|
||||
const PLACEHOLDER_SEPARATOR = '@I18N@';
|
||||
|
||||
export function i18nDirective(
|
||||
export const i18nDirective: [string, string, typeof i18nDirectiveFn] = [
|
||||
'i18n',
|
||||
'$sanitize',
|
||||
i18nDirectiveFn,
|
||||
];
|
||||
|
||||
function i18nDirectiveFn(
|
||||
i18n: I18nServiceType,
|
||||
$sanitize: (html: string) => string
|
||||
): IDirective<I18nScope> {
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
|
||||
import { I18nServiceType } from './provider';
|
||||
|
||||
export function i18nFilter(i18n: I18nServiceType) {
|
||||
export const i18nFilter: [string, typeof i18nFilterFn] = ['i18n', i18nFilterFn];
|
||||
|
||||
function i18nFilterFn(i18n: I18nServiceType) {
|
||||
return (id: string, { defaultMessage = '', values = {} } = {}) => {
|
||||
return i18n(id, {
|
||||
values,
|
||||
|
|
|
@ -30,6 +30,9 @@ export const ElasticEui = require('@elastic/eui');
|
|||
export const ElasticEuiLibServices = require('@elastic/eui/lib/services');
|
||||
export const ElasticEuiLightTheme = require('@elastic/eui/dist/eui_theme_light.json');
|
||||
export const ElasticEuiDarkTheme = require('@elastic/eui/dist/eui_theme_dark.json');
|
||||
export const KbnI18n = require('@kbn/i18n');
|
||||
export const KbnI18nAngular = require('@kbn/i18n/angular');
|
||||
export const KbnI18nReact = require('@kbn/i18n/react');
|
||||
export const Moment = require('moment');
|
||||
export const MomentTimezone = require('moment-timezone/moment-timezone');
|
||||
export const React = require('react');
|
||||
|
|
|
@ -30,6 +30,9 @@ exports.externals = {
|
|||
'@elastic/eui/lib/services': '__kbnSharedDeps__.ElasticEuiLibServices',
|
||||
'@elastic/eui/dist/eui_theme_light.json': '__kbnSharedDeps__.ElasticEuiLightTheme',
|
||||
'@elastic/eui/dist/eui_theme_dark.json': '__kbnSharedDeps__.ElasticEuiDarkTheme',
|
||||
'@kbn/i18n': '__kbnSharedDeps__.KbnI18n',
|
||||
'@kbn/i18n/angular': '__kbnSharedDeps__.KbnI18nAngular',
|
||||
'@kbn/i18n/react': '__kbnSharedDeps__.KbnI18nReact',
|
||||
jquery: '__kbnSharedDeps__.Jquery',
|
||||
moment: '__kbnSharedDeps__.Moment',
|
||||
'moment-timezone': '__kbnSharedDeps__.MomentTimezone',
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"@elastic/eui": "18.2.1",
|
||||
"@elastic/charts": "^16.1.0",
|
||||
"@kbn/dev-utils": "1.0.0",
|
||||
"@kbn/i18n": "1.0.0",
|
||||
"@yarnpkg/lockfile": "^1.1.0",
|
||||
"abortcontroller-polyfill": "^1.3.0",
|
||||
"angular": "^1.7.9",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue