diff --git a/src/i18n/languages/es.ts b/src/i18n/languages/es.ts new file mode 100644 index 0000000..24008e1 --- /dev/null +++ b/src/i18n/languages/es.ts @@ -0,0 +1,38 @@ +import Key from '../i18nKey' +import type { Translation } from '../translation' + +export const es: Translation = { + [Key.home]: 'Inicio', + [Key.about]: 'Sobre mí', + [Key.archive]: 'Archivo', + [Key.search]: 'Buscar', + + [Key.tags]: 'Etiquetas', + [Key.categories]: 'Categorías', + [Key.recentPosts]: 'Publicaciones recientes', + + [Key.comments]: 'Comentarios', + + [Key.untitled]: 'Sin título', + [Key.uncategorized]: 'Sin categoría', + [Key.noTags]: 'Sin etiquetas', + + [Key.wordCount]: 'palabra', + [Key.wordsCount]: 'palabras', + [Key.minuteCount]: 'minuto', + [Key.minutesCount]: 'minutos', + [Key.postCount]: 'publicación', + [Key.postsCount]: 'publicaciones', + + [Key.themeColor]: 'Color del tema', + + [Key.lightMode]: 'Claro', + [Key.darkMode]: 'Oscuro', + [Key.systemMode]: 'Sistema', + + [Key.more]: 'Más', + + [Key.author]: 'Autor', + [Key.publishedAt]: 'Publicado el', + [Key.license]: 'Licencia', +} diff --git a/src/i18n/translation.ts b/src/i18n/translation.ts index 08c3a95..38934fb 100644 --- a/src/i18n/translation.ts +++ b/src/i18n/translation.ts @@ -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] -} +} \ No newline at end of file