From de86f122320be7a41cd94476c8a9424c7c766b19 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 12 Aug 2023 20:33:36 +0100 Subject: Defines translations for language links --- src/i18n/translations/components/languageLinks.ts | 11 +++++++++++ src/i18n/translations/site.ts | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/i18n/translations/components/languageLinks.ts (limited to 'src') diff --git a/src/i18n/translations/components/languageLinks.ts b/src/i18n/translations/components/languageLinks.ts new file mode 100644 index 0000000..d3db24a --- /dev/null +++ b/src/i18n/translations/components/languageLinks.ts @@ -0,0 +1,11 @@ +import type { TranslationsDictionary } from '../../../types/TranslationsDictionary'; + +const languageLinksTranslations = { + 'language-link-text': { + sco: ({ language }: { language: string }) => `Get this page i ${language}`, + 'en-GB': ({ language }: { language: string }) => `Get this page in ${language}`, + }, +}; + +type Raw = typeof languageLinksTranslations; +export default languageLinksTranslations as TranslationsDictionary; diff --git a/src/i18n/translations/site.ts b/src/i18n/translations/site.ts index b414499..66c95cd 100644 --- a/src/i18n/translations/site.ts +++ b/src/i18n/translations/site.ts @@ -1,3 +1,4 @@ +import type Locale from '../../types/Locale'; import type { TranslationsDictionary } from '../../types/TranslationsDictionary'; const siteTranslations = { @@ -17,6 +18,24 @@ const siteTranslations = { sco: () => 'bi', 'en-GB': () => 'by', }, + locale: { + sco: ({ locale }: { locale: Locale }) => { + switch (locale) { + case 'sco': + return 'Scots'; + case 'en-GB': + return 'Inglis'; + } + }, + 'en-GB': ({ locale }: { locale: Locale }) => { + switch (locale) { + case 'sco': + return 'Scots'; + case 'en-GB': + return 'English'; + } + }, + }, }; type Raw = typeof siteTranslations; -- cgit v1.2.3