From 90254344d599bc977c0661f7c9681b7509a9076e Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 5 Aug 2023 21:16:45 +0100 Subject: Moves to root folder --- frontend/src/i18n/locales.ts | 16 ---------------- frontend/src/i18n/translate.ts | 9 --------- frontend/src/i18n/translations/pages/home.ts | 11 ----------- frontend/src/i18n/translations/site.ts | 15 --------------- 4 files changed, 51 deletions(-) delete mode 100644 frontend/src/i18n/locales.ts delete mode 100644 frontend/src/i18n/translate.ts delete mode 100644 frontend/src/i18n/translations/pages/home.ts delete mode 100644 frontend/src/i18n/translations/site.ts (limited to 'frontend/src/i18n') diff --git a/frontend/src/i18n/locales.ts b/frontend/src/i18n/locales.ts deleted file mode 100644 index 4192e3f..0000000 --- a/frontend/src/i18n/locales.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type Locale from '../types/Locale'; - -// Use the magic of TypeScript to guarantee completeness -const localesHash: { [key in Locale]: 1 } = { - 'sco': 1, - 'en-GB': 1, -}; - -// Use the magic of TypeScript to guarantee that the -// default locale is a locale, but also have const -// string type -const defaultLocaleAsLocale: Locale = 'sco'; -const defaultLocale: 'sco' = defaultLocaleAsLocale; - -export { defaultLocale }; -export default Object.keys(localesHash) as Locale[]; \ No newline at end of file diff --git a/frontend/src/i18n/translate.ts b/frontend/src/i18n/translate.ts deleted file mode 100644 index c0d5620..0000000 --- a/frontend/src/i18n/translate.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type Locale from "../types/Locale"; -import type { TranslationsDictionary } from "../types/TranslationsDictionary"; -import { defaultLocale } from "./locales"; - -export default function(locale: Locale) { - return function(dict: TranslationsDictionary, key: T) { - return dict[key][locale] ?? dict[key][defaultLocale]; - } -} \ No newline at end of file diff --git a/frontend/src/i18n/translations/pages/home.ts b/frontend/src/i18n/translations/pages/home.ts deleted file mode 100644 index 1415024..0000000 --- a/frontend/src/i18n/translations/pages/home.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { TranslationsDictionary } from "../../../types/TranslationsDictionary"; - -const homeTranslations = { - 'title': { - 'sco': 'Hame', - 'en-GB': 'Home', - }, -}; - -type Keys = keyof typeof homeTranslations; -export default homeTranslations as TranslationsDictionary; \ No newline at end of file diff --git a/frontend/src/i18n/translations/site.ts b/frontend/src/i18n/translations/site.ts deleted file mode 100644 index 1172846..0000000 --- a/frontend/src/i18n/translations/site.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { TranslationsDictionary } from "../../types/TranslationsDictionary"; - -const siteTranslations = { - 'title': { - '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; -export default siteTranslations as TranslationsDictionary; \ No newline at end of file -- cgit v1.2.3