mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-12 23:32:53 +01:00
feat: add Spanish i18n (#157)
* Create es.ts Added Spanish translation for site content and interface elements. * Update translation.ts Added Spanish (es) translation support to the language configuration.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { siteConfig } from '../config'
|
||||
import type I18nKey from './i18nKey'
|
||||
import { en } from './languages/en'
|
||||
import { es } from './languages/es'
|
||||
import { ja } from './languages/ja'
|
||||
import { ko } from './languages/ko'
|
||||
import { zh_CN } from './languages/zh_CN'
|
||||
import { zh_TW } from './languages/zh_TW'
|
||||
import { ko } from './languages/ko'
|
||||
|
||||
export type Translation = {
|
||||
[K in I18nKey]: string
|
||||
@@ -13,6 +14,7 @@ export type Translation = {
|
||||
const defaultTranslation = en
|
||||
|
||||
const map: { [key: string]: Translation } = {
|
||||
es: es,
|
||||
en: en,
|
||||
en_us: en,
|
||||
en_gb: en,
|
||||
@@ -32,4 +34,4 @@ export function getTranslation(lang: string): Translation {
|
||||
export function i18n(key: I18nKey): string {
|
||||
const lang = siteConfig.lang || 'en'
|
||||
return getTranslation(lang)[key]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user