reworked slider + added coaches page
This commit is contained in:
@@ -3,6 +3,8 @@ export const languages = {
|
||||
ru: 'Русский',
|
||||
}
|
||||
|
||||
export type TranslationKey = keyof (typeof ui)[keyof typeof ui]
|
||||
|
||||
export const ui = {
|
||||
ru: {
|
||||
'seo.meta.description':
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ui } from './ui'
|
||||
import { ui, type TranslationKey } from './ui'
|
||||
|
||||
import { i18n } from 'astro:config/client'
|
||||
|
||||
@@ -11,7 +11,7 @@ export function getLangFromUrl(url: URL) {
|
||||
}
|
||||
|
||||
export function useTranslations(lang?: string) {
|
||||
return function t(key: keyof (typeof ui)[keyof typeof ui]) {
|
||||
return function t(key: TranslationKey) {
|
||||
return ui[lang as keyof typeof ui]?.[key] || ui[i18n!.defaultLocale as keyof typeof ui][key]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user