Remove i18n, keep only Italian and rely on browser translation
The interface was translated in en/it/es/fr via @nuxtjs/i18n. Drop the module, the locale files, and the language switcher: the UI is now static Italian text, with translation for foreign visitors left to the Google Translate browser extension instead of the app.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Category } from '#shared/types/blog'
|
||||
|
||||
const { locale } = useI18n()
|
||||
|
||||
const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
key: 'nav-categories',
|
||||
default: () => [],
|
||||
@@ -11,29 +9,28 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<a class="skip-link" href="#main">{{ $t('site.skipToContent') }}</a>
|
||||
<a class="skip-link" href="#main">Vai al contenuto</a>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<p class="wordmark">
|
||||
<NuxtLinkLocale to="/">
|
||||
<NuxtLink to="/">
|
||||
<img src="/logo.png" :alt="SITE_NAME" width="400" height="400">
|
||||
</NuxtLinkLocale>
|
||||
</NuxtLink>
|
||||
</p>
|
||||
<p class="tagline kicker">{{ $t('site.tagline') }}</p>
|
||||
<p class="tagline kicker">Articoli, guide e analisi.</p>
|
||||
</div>
|
||||
|
||||
<nav class="site-nav" :aria-label="$t('site.mainNavigation')">
|
||||
<nav class="site-nav" aria-label="Navigazione principale">
|
||||
<div class="container nav-inner">
|
||||
<ul>
|
||||
<li><NuxtLinkLocale to="/blog">{{ $t('site.allArticles') }}</NuxtLinkLocale></li>
|
||||
<li><NuxtLink to="/blog">Tutti gli articoli</NuxtLink></li>
|
||||
<li v-for="category in categories" :key="category.slug">
|
||||
<NuxtLinkLocale :to="`/category/${category.slug}`">
|
||||
<NuxtLink :to="`/category/${category.slug}`">
|
||||
{{ category.name }}
|
||||
</NuxtLinkLocale>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
<LanguageSwitcher />
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
@@ -46,35 +43,35 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
<div class="container footer-inner">
|
||||
<div class="footer-block">
|
||||
<img class="footer-logo" src="/logo.png" :alt="SITE_NAME" width="400" height="400">
|
||||
<p class="muted">{{ $t('site.tagline') }}</p>
|
||||
<p class="muted">Articoli, guide e analisi.</p>
|
||||
<address class="contact">
|
||||
{{ $t('site.contact') }}:
|
||||
Contatti:
|
||||
<a :href="`mailto:${SITE_EMAIL}`">{{ SITE_EMAIL }}</a>
|
||||
</address>
|
||||
</div>
|
||||
|
||||
<nav class="footer-block" :aria-label="$t('site.categories')">
|
||||
<p class="kicker">{{ $t('site.categories') }}</p>
|
||||
<nav class="footer-block" aria-label="Categorie">
|
||||
<p class="kicker">Categorie</p>
|
||||
<ul>
|
||||
<li v-for="category in categories" :key="category.slug">
|
||||
<NuxtLinkLocale :to="`/category/${category.slug}`">
|
||||
<NuxtLink :to="`/category/${category.slug}`">
|
||||
{{ category.name }}
|
||||
</NuxtLinkLocale>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li v-if="!categories.length" class="muted">{{ $t('site.noCategories') }}</li>
|
||||
<li v-if="!categories.length" class="muted">Ancora nessuna pubblicazione</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<nav class="footer-block" :aria-label="$t('site.browse')">
|
||||
<p class="kicker">{{ $t('site.browse') }}</p>
|
||||
<nav class="footer-block" aria-label="Naviga">
|
||||
<p class="kicker">Naviga</p>
|
||||
<ul>
|
||||
<li><NuxtLinkLocale to="/">{{ $t('site.home') }}</NuxtLinkLocale></li>
|
||||
<li><NuxtLinkLocale to="/blog">{{ $t('site.allArticles') }}</NuxtLinkLocale></li>
|
||||
<li><NuxtLink to="/">Home</NuxtLink></li>
|
||||
<li><NuxtLink to="/blog">Tutti gli articoli</NuxtLink></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<nav class="footer-block" :aria-label="$t('site.follow')">
|
||||
<p class="kicker">{{ $t('site.follow') }}</p>
|
||||
<nav class="footer-block" aria-label="Seguici">
|
||||
<p class="kicker">Seguici</p>
|
||||
<ul>
|
||||
<li v-for="social in SOCIAL_LINKS" :key="social.name">
|
||||
<a class="social" :href="social.url" target="_blank" rel="noopener me">
|
||||
@@ -86,8 +83,8 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<p class="container copyright kicker" :lang="locale">
|
||||
© {{ new Date().getFullYear() }} {{ SITE_NAME }}. {{ $t('site.rights') }}
|
||||
<p class="container copyright kicker">
|
||||
© {{ new Date().getFullYear() }} {{ SITE_NAME }}. Tutti i diritti riservati.
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -137,13 +134,9 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
border-top: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
/* Phones stack the links above the language picker, both centred; from tablet
|
||||
up they sit on one line with the picker pushed to the right. */
|
||||
.nav-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
justify-content: center;
|
||||
padding-block: 0.6rem;
|
||||
}
|
||||
|
||||
@@ -167,10 +160,6 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
}
|
||||
|
||||
.nav-inner {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem 2rem;
|
||||
padding-block: 0.9rem;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user