* Translate url * Fix issues * Fix issues
This commit is contained in:
parent
8596da5d51
commit
a1ccf243dc
|
@ -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: <MarkdownSimple>{error.message}</MarkdownSimple>,
|
||||
});
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue