Fixes broken URLs

This commit is contained in:
Moritz Kröger 2019-04-12 22:54:08 +02:00
parent e2cfc20341
commit 9b07778a12
6 changed files with 16 additions and 14 deletions

View file

@ -1,7 +1,7 @@
<template>
<div id="app">
<header class="app-header">
<router-link :to="{ path: '/' }">
<router-link :to="{ path: `/${$i18n.locale}/` }">
<img class="header-logo"
:src="euromatLogo"
:width="logoSize"

View file

@ -1,6 +1,6 @@
{
"language": "de",
"url": "faq",
"url": "haufige-fragen",
"title": "Häufig gestellte Fragen",
"headline": "FAQ",
"questions": [

View file

@ -1,10 +1,11 @@
import { getTranslatedTitles } from '@/i18n/helper'
import { DEFAULT_LOCALE } from '@/config'
import { getTranslatedAliases, getTranslatedTitles } from '@/i18n/helper'
import i18n from './i18n'
export default [
{
path: 'faq',
// alias: getTranslatedAliases('faq'),
path: i18n[DEFAULT_LOCALE].faq.url,
alias: getTranslatedAliases(i18n, 'faq'),
name: 'faq',
component: () => import('./components/index' /* webpackChunkName: "faq" */),
meta: {

View file

@ -1,8 +1,9 @@
export default {
de: {
imprint: {
pageTitle: 'Impressum',
title: 'Impressum',
headline: 'Impressum',
url: 'impressum',
address: {
label: 'Adresse',
polis: [
@ -87,8 +88,9 @@ export default {
},
en: {
imprint: {
pageTitle: 'Imprint',
title: 'Imprint',
headline: 'Imprint',
url: 'imprint',
address: {
label: 'Address',
polis: [

View file

@ -1,16 +1,15 @@
import { DEFAULT_LOCALE } from '@/config'
import { getTranslatedAliases, getTranslatedTitles } from '@/i18n/helper'
import i18n from './i18n'
export default [
{
path: 'impressum',
alias: 'imprint',
path: i18n[DEFAULT_LOCALE].imprint.url,
alias: getTranslatedAliases(i18n, 'imprint'),
name: 'imprint',
component: () => import('./components/index' /* webpackChunkName: "misc" */),
meta: {
title: {
de: i18n.de.imprint.pageTitle,
en: i18n.en.imprint.pageTitle
}
title: getTranslatedTitles(i18n, 'imprint')
}
}
]

View file

@ -46,7 +46,7 @@ export function getTranslatedAliases (data, section) {
return [...new Set(
Object.keys(data)
.filter(lang => lang !== DEFAULT_LOCALE)
.map(lang => '/' + data[lang][section].url)
.map(lang => data[lang][section].url)
.filter(Boolean)
)]
}