summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Carstairs <jcarstairs@scottlogic.com>2023-08-04 19:04:54 +0100
committerJoe Carstairs <jcarstairs@scottlogic.com>2023-08-04 19:04:54 +0100
commit62c23f65d3e838f05d0a71c00cadb29c92fb9e0f (patch)
tree7fb8e04d66fed1c82fef3b043678e1142b25cfa8
parent44ee01331fd7f7f8426b3771244692e263340a15 (diff)
Translates site title
-rw-r--r--frontend/src/i18n/translations/site.ts4
-rw-r--r--frontend/src/layouts/Layout.astro11
-rw-r--r--frontend/src/pages/[locale]/index.astro2
3 files changed, 13 insertions, 4 deletions
diff --git a/frontend/src/i18n/translations/site.ts b/frontend/src/i18n/translations/site.ts
index 83ce224..1172846 100644
--- a/frontend/src/i18n/translations/site.ts
+++ b/frontend/src/i18n/translations/site.ts
@@ -5,6 +5,10 @@ const siteTranslations = {
'sco': 'Scots Leid Associe',
'en-GB': 'Scots Language Society',
},
+ 'description': {
+ 'sco': 'The wabsteid o the Scots Leid Associe',
+ 'en-GB': 'The website of the Scots Language Society',
+ }
};
type Keys = keyof typeof siteTranslations;
diff --git a/frontend/src/layouts/Layout.astro b/frontend/src/layouts/Layout.astro
index 1a47613..b17de4d 100644
--- a/frontend/src/layouts/Layout.astro
+++ b/frontend/src/layouts/Layout.astro
@@ -1,24 +1,29 @@
---
import Footer from '../components/Footer.astro';
+import translate from '../i18n/translate';
+import site from '../i18n/translations/site';
+import type Locale from '../types/Locale';
interface Props {
+ locale: Locale;
title: string;
}
-const { title } = Astro.props;
+const { locale, title } = Astro.props;
+const t = translate(locale);
---
<!DOCTYPE html>
<html lang="sco">
<head>
<meta charset="UTF-8" />
- <meta name="description" content="The wabsteid o the Scots Leid Associe" />
+ <meta name="description" content={ t(site, 'description') } />
<meta name="viewport" content="width=device-width" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/public/normalize.css" />
<link rel="stylesheet" href="/public/main.css" />
<meta name="generator" content={Astro.generator} />
- <title>{title} | Scots Leid Associe</title>
+ <title>{ title } | { t(site, 'title') }</title>
</head>
<body>
<slot />
diff --git a/frontend/src/pages/[locale]/index.astro b/frontend/src/pages/[locale]/index.astro
index 0359f45..23a270d 100644
--- a/frontend/src/pages/[locale]/index.astro
+++ b/frontend/src/pages/[locale]/index.astro
@@ -12,7 +12,7 @@ const locale = Astro.params.locale as Locale;
const t = translate(locale);
---
-<Layout title={ t(home, 'title') }>
+<Layout locale={locale} title={ t(home, 'title') }>
<main id="main">
<section>
<h1 class="title">{ t(site, 'title') }</h1>