diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-12 20:33:36 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-12 20:33:36 +0100 |
| commit | de86f122320be7a41cd94476c8a9424c7c766b19 (patch) | |
| tree | 4862d06e44acf8a2bc506c6cbaefe8100d8fe705 /src | |
| parent | e9755981b06470c495edde3fbfc3934b1bc5c107 (diff) | |
Defines translations for language links
Diffstat (limited to 'src')
| -rw-r--r-- | src/i18n/translations/components/languageLinks.ts | 11 | ||||
| -rw-r--r-- | src/i18n/translations/site.ts | 19 |
2 files changed, 30 insertions, 0 deletions
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<Raw>; 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; |
