Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Jan 7, 2020
1 parent ea03425 commit 2d03066
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
16 changes: 14 additions & 2 deletions x-pack/legacy/plugins/reporting/server/lib/validate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';
import { ServerFacade, Logger } from '../../../types';
import { HeadlessChromiumDriverFactory } from '../../browsers/chromium/driver_factory';
import { validateBrowser } from './validate_browser';
Expand All @@ -23,8 +24,19 @@ export async function runValidations(
validateMaxContentLength(server, logger),
validateServerHost(server),
]);
logger.debug(`Reporting plugin self-check ok!`);
logger.debug(
i18n.translate('xpack.reporting.selfCheck.ok', {
defaultMessage: `Reporting plugin self-check ok!`,
})
);
} catch (err) {
logger.warning(`Reporting plugin self-check generated a warning: ${err}`);
logger.warning(
i18n.translate('xpack.reporting.selfCheck.warning', {
defaultMessage: `Reporting plugin self-check generated a warning: {err}`,
values: {
err,
},
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';
import crypto from 'crypto';
import { ServerFacade, Logger } from '../../../types';

Expand All @@ -14,8 +15,14 @@ export function validateEncryptionKey(serverFacade: ServerFacade, logger: Logger
if (encryptionKey == null) {
// TODO this should simply throw an error and let the handler conver it to a warning mesasge. See validateServerHost.
logger.warning(
`Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set ` +
`xpack.reporting.encryptionKey in kibana.yml`
i18n.translate('xpack.reporting.selfCheckEncryptionKey.warning', {
defaultMessage:
`Generating a random key for {setting}. To prevent pending reports ` +
`from failing on restart, please set {setting} in kibana.yml`,
values: {
setting: 'xpack.reporting.encryptionKey',
},
})
);

// @ts-ignore: No set() method on KibanaConfig, just get() and has()
Expand Down

0 comments on commit 2d03066

Please sign in to comment.