diff --git a/src/ui/public/url/redirect_when_missing.js b/src/ui/public/url/redirect_when_missing.js index f9243e1073802..cecc9a77a4de1 100644 --- a/src/ui/public/url/redirect_when_missing.js +++ b/src/ui/public/url/redirect_when_missing.js @@ -27,7 +27,7 @@ import { uiModules } from '../modules'; uiModules.get('kibana/url') .service('redirectWhenMissing', function (Private) { return Private(RedirectWhenMissingProvider); }); -export function RedirectWhenMissingProvider($location, kbnUrl, Promise) { +export function RedirectWhenMissingProvider($location, kbnUrl, Promise, i18n) { /** * Creates an error handler that will redirect to a url when a SavedObjectNotFound * error is thrown @@ -57,7 +57,9 @@ export function RedirectWhenMissingProvider($location, kbnUrl, Promise) { url += (url.indexOf('?') >= 0 ? '&' : '?') + `notFound=${error.savedObjectType}`; toastNotifications.addWarning({ - title: 'Saved object is missing', + title: i18n('common.ui.url.savedObjectIsMissingNotificationMessage', { + defaultMessage: 'Saved object is missing' + }), text: {error.message}, }); diff --git a/src/ui/public/url/url.js b/src/ui/public/url/url.js index 7ce318054c0f0..dbb454b80dbc6 100644 --- a/src/ui/public/url/url.js +++ b/src/ui/public/url/url.js @@ -26,7 +26,7 @@ import { AppStateProvider } from '../state_management/app_state'; uiModules.get('kibana/url') .service('kbnUrl', function (Private) { return Private(KbnUrlProvider); }); -export function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) { +export function KbnUrlProvider($injector, $location, $rootScope, $parse, Private, i18n) { /** * the `kbnUrl` service was created to smooth over some of the * inconsistent behavior that occurs when modifying the url via @@ -114,7 +114,11 @@ export function KbnUrlProvider($injector, $location, $rootScope, $parse, Private // if evaluation can't be made, throw if (_.isUndefined(p)) { - throw new Error('Replacement failed, unresolved expression: ' + expr); + throw new Error( + i18n('common.ui.url.replacementFailedErrorMessage', { + defaultMessage: 'Replacement failed, unresolved expression: {expr}', + values: { expr } + })); } // append uriescape filter if not included