From d3f3334553bf9ac5ed650b45c9f2ef6a20539e17 Mon Sep 17 00:00:00 2001 From: Carlos Talavera <43124259+carlos-talavera@users.noreply.github.com> Date: Thu, 19 Sep 2024 00:02:31 -0600 Subject: [PATCH] feat: add spanish language (#2721) Add support for Spanish language --- docs/src/en/guide/features/i18n.md | 2 + docs/src/en/reference/client/props.md | 2 + docs/src/guide/features/i18n.md | 2 + docs/src/reference/client/props.md | 2 + packages/client/src/config/i18n/es.ts | 53 ++++++++++++++++++++++++ packages/client/src/config/i18n/index.ts | 5 ++- packages/hexo-next/README.md | 2 +- 7 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 packages/client/src/config/i18n/es.ts diff --git a/docs/src/en/guide/features/i18n.md b/docs/src/en/guide/features/i18n.md index 1963ed2923b..665b82cc3ca 100644 --- a/docs/src/en/guide/features/i18n.md +++ b/docs/src/en/guide/features/i18n.md @@ -28,6 +28,8 @@ You can set the language used by Waline through the `lang` option. The supported - fr - vi - vi-vn +- es +- es-MX E.g.: diff --git a/docs/src/en/reference/client/props.md b/docs/src/en/reference/client/props.md index a039d1ddbfb..a1f60ea08df 100644 --- a/docs/src/en/reference/client/props.md +++ b/docs/src/en/reference/client/props.md @@ -49,6 +49,8 @@ Optional value: - `'ru-RU'` - `fr-FR` - `fr` +- `'es'` +- `'es-MX'` ## locale diff --git a/docs/src/guide/features/i18n.md b/docs/src/guide/features/i18n.md index dc22a12ff87..f3faf702843 100644 --- a/docs/src/guide/features/i18n.md +++ b/docs/src/guide/features/i18n.md @@ -28,6 +28,8 @@ Waline 内置多种语言支持,你也可以自定义 Waline 的语言配置 - fr - vi - vi-vn +- es +- es-MX 例如: diff --git a/docs/src/reference/client/props.md b/docs/src/reference/client/props.md index 6b398e37813..648f39fb6b5 100644 --- a/docs/src/reference/client/props.md +++ b/docs/src/reference/client/props.md @@ -49,6 +49,8 @@ Waline 的服务端地址。 - `'ru-RU'` - `fr-FR` - `fr` +- `'es'` +- `'es-MX'` ## locale diff --git a/packages/client/src/config/i18n/es.ts b/packages/client/src/config/i18n/es.ts new file mode 100644 index 00000000000..a0f0f99ab86 --- /dev/null +++ b/packages/client/src/config/i18n/es.ts @@ -0,0 +1,53 @@ +import { generateLocale } from './generate.js'; + +export default generateLocale([ + 'Nombre de usuario', + 'El nombre de usuario no puede tener menos de 3 bytes.', + 'Correo electrónico', + 'Por favor confirma tu dirección de correo electrónico.', + 'Sitio web', + 'Opcional', + 'Comenta aquí...', + 'Sin comentarios todavía.', + 'Enviar', + 'Like', + 'Anular like', + 'Responder', + 'Anular respuesta', + 'Comentarios', + 'Recargar', + 'Cargar Más...', + 'Previsualizar', + 'Emoji', + 'Subir Imagen', + 'segundos atrás', + 'minutos atrás', + 'horas atrás', + 'días atrás', + 'justo ahora', + 'Subiendo', + 'Iniciar sesión', + 'cerrar sesión', + 'Admin', + 'Fijado', + 'Palabras', + 'Por favor escriba entre $0 y $1 palabras!\n El número actual de palabras: $2', + 'Anónimo', + 'Enanos', + 'Hobbits', + 'Ents', + 'Magos', + 'Elfos', + 'Maiar', + 'GIF', + 'Buscar GIF', + 'Perfil', + 'Aprobado', + 'Esperando', + 'Spam', + 'Desfijar', + 'Más antiguos', + 'Más recientes', + 'Más vistos', + '¿Qué piensas?', +]); diff --git a/packages/client/src/config/i18n/index.ts b/packages/client/src/config/i18n/index.ts index dd7c1c7740a..71a64e6a625 100644 --- a/packages/client/src/config/i18n/index.ts +++ b/packages/client/src/config/i18n/index.ts @@ -1,5 +1,7 @@ +import type { WalineLocale } from '../../typings/index.js'; import de from './de.js'; import en from './en.js'; +import es from './es.js'; import fr from './fr.js'; import jp from './jp.js'; import ptBR from './pt-BR.js'; @@ -7,7 +9,6 @@ import ru from './ru.js'; import viVN from './vi-VN.js'; import zhCN from './zh-CN.js'; import zhTW from './zh-TW.js'; -import type { WalineLocale } from '../../typings/index.js'; export type Locales = Record; @@ -29,6 +30,8 @@ export const DEFAULT_LOCALES: Locales = { vi: viVN, 'vi-vn': viVN, de, + es, + 'es-mx': es, }; export const getLocale = (lang: string): WalineLocale => diff --git a/packages/hexo-next/README.md b/packages/hexo-next/README.md index f562b94fa5f..0e173af03f5 100644 --- a/packages/hexo-next/README.md +++ b/packages/hexo-next/README.md @@ -62,7 +62,7 @@ waline: # requiredMeta: # - nick - # Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP, fr-FR + # Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP, fr-FR, es-MX # lang: zh-CN # Word limit, no limit when setting to 0