Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Uptime] Translate bare strings #75918

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
})
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this needs translation :)

This is developer facing error.

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