Skip to content

Commit

Permalink
Translate a bare string.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Aug 25, 2020
1 parent e9446b2 commit 04fdc2e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export function* setDynamicSettingsEffect() {
yield takeLatest(String(setDynamicSettings), function* (action: Action<DynamicSettings>) {
try {
if (!action.payload) {
const err = new Error('Cannot fetch effect without a payload');
const err = new Error(
i18n.translate('xpack.uptime.settings.errorMessage', {
defaultMessage: 'Cannot fetch effect without a payload',
})
);
yield put(setDynamicSettingsFail(err));

kibanaService.core.notifications.toasts.addError(err, {
Expand All @@ -47,7 +51,11 @@ export function* setDynamicSettingsEffect() {
}
yield call(setDynamicSettingsAPI, { settings: action.payload });
yield put(setDynamicSettingsSuccess(action.payload));
kibanaService.core.notifications.toasts.addSuccess('Settings saved!');
kibanaService.core.notifications.toasts.addSuccess(
i18n.translate('xpack.uptime.settings.saveSuccess', {
defaultMessage: 'Settings saved!',
})
);
} catch (err) {
kibanaService.core.notifications.toasts.addError(err, {
title: couldNotSaveSettingsText,
Expand Down

0 comments on commit 04fdc2e

Please sign in to comment.