mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Text for 403 error is localized
I hacked the error.vue to catch the default 404 error message and to display a localized message instead. I found no better way to do it. Any ideas?
This commit is contained in:
parent
a4907f2bcb
commit
7315cacb5a
@ -2,7 +2,10 @@
|
||||
<div class="error-container">
|
||||
<base-icon class="error-icon" name="exclamation-circle" />
|
||||
<br />
|
||||
<span class="error-message">{{ $t(error.message) }}</span>
|
||||
<span v-if="error.message === 'This page could not be found'" class="error-message">
|
||||
{{ $t('error-pages.default') }}
|
||||
</span>
|
||||
<span v-else class="error-message">{{ $t(error.message) }}</span>
|
||||
<br />
|
||||
<nuxt-link to="/">{{ $t('error-pages.back-to-index') }}</nuxt-link>
|
||||
</div>
|
||||
|
||||
@ -803,6 +803,8 @@
|
||||
"profile-not-found": "Dieses Profil konnte nicht gefunden werden",
|
||||
"back-to-index": "Zurück zur Startseite",
|
||||
"post-not-found": "Dieser Beitrag konnte nicht gefunden werden",
|
||||
"cannot-edit-post": "Dieser Beitrag kann nicht editiert werden"
|
||||
"cannot-edit-post": "Dieser Beitrag kann nicht editiert werden",
|
||||
"default": "Diese Seite konnte nicht gefunden werden",
|
||||
"not-authorized": "Kein Zugang zu dieser Seite"
|
||||
}
|
||||
}
|
||||
|
||||
@ -803,7 +803,9 @@
|
||||
"profile-not-found": "This profile could not be found",
|
||||
"back-to-index": "Back to index page",
|
||||
"post-not-found": "This post could not be found",
|
||||
"cannot-edit-post": "This post cannot be edited"
|
||||
"cannot-edit-post": "This post cannot be edited",
|
||||
"default": "This page could not be found",
|
||||
"not-authorized": "Not authorized to this page"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export default ({ store, error }) => {
|
||||
if (!store.getters['auth/isAdmin']) {
|
||||
return error({ statusCode: 403 })
|
||||
return error({ statusCode: 403, message: 'error-pages.not-authorized' })
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export default ({ store, error }) => {
|
||||
if (!store.getters['auth/isModerator']) {
|
||||
return error({ statusCode: 403 })
|
||||
return error({ statusCode: 403, message: 'error-pages.not-authorized' })
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user