diff options
| author | Joe Carstairs <jcarstairs@scottlogic.com> | 2023-08-07 18:18:22 +0100 |
|---|---|---|
| committer | Joe Carstairs <jcarstairs@scottlogic.com> | 2023-08-07 18:19:06 +0100 |
| commit | 2fcbccfbd49c6eaf433272749e32589a6f490200 (patch) | |
| tree | f8fc429709d66ce96d1f0e8c3812f24c13bf9d18 /frontend/src/i18n | |
| parent | d494739e4823424bb54d81e21b57e4725544eb07 (diff) | |
| parent | 27a25bfdeb07007e06bd4a608cd9953be04271ec (diff) | |
Merge branch 'master' of https://github.com/jcarstairs-scottlogic/lallans-wabsteid-astro
Diffstat (limited to 'frontend/src/i18n')
| -rw-r--r-- | frontend/src/i18n/locales.ts | 16 | ||||
| -rw-r--r-- | frontend/src/i18n/translate.ts | 9 | ||||
| -rw-r--r-- | frontend/src/i18n/translations/pages/furthsettins.ts | 11 | ||||
| -rw-r--r-- | frontend/src/i18n/translations/pages/home.ts | 11 | ||||
| -rw-r--r-- | frontend/src/i18n/translations/site.ts | 19 |
5 files changed, 0 insertions, 66 deletions
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<T extends string>(dict: TranslationsDictionary<T>, key: T) { - return dict[key][locale] ?? dict[key][defaultLocale]; - } -}
\ No newline at end of file diff --git a/frontend/src/i18n/translations/pages/furthsettins.ts b/frontend/src/i18n/translations/pages/furthsettins.ts deleted file mode 100644 index c46e2ad..0000000 --- a/frontend/src/i18n/translations/pages/furthsettins.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { TranslationsDictionary } from "../../../types/TranslationsDictionary"; - -const furthsettinsTranslations = { - 'title': { - 'sco': 'Furthsettins', - 'en-GB': 'Publications', - }, -}; - -type Keys = keyof typeof furthsettinsTranslations; -export default furthsettinsTranslations as TranslationsDictionary<Keys>;
\ 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<Keys>;
\ 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 6699619..0000000 --- a/frontend/src/i18n/translations/site.ts +++ /dev/null @@ -1,19 +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', - }, - 'lallans': { - 'sco': 'Lallans', - 'en-GB': 'Lallans', - } -}; - -type Keys = keyof typeof siteTranslations; -export default siteTranslations as TranslationsDictionary<Keys>;
\ No newline at end of file |
