Skip to content

Commit

Permalink
feat: add spanish language (#2721)
Browse files Browse the repository at this point in the history
Add support for Spanish language
  • Loading branch information
carlos-talavera authored Sep 19, 2024
1 parent ec5277f commit d3f3334
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/src/en/guide/features/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.:

Expand Down
2 changes: 2 additions & 0 deletions docs/src/en/reference/client/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Optional value:
- `'ru-RU'`
- `fr-FR`
- `fr`
- `'es'`
- `'es-MX'`

## locale

Expand Down
2 changes: 2 additions & 0 deletions docs/src/guide/features/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Waline 内置多种语言支持,你也可以自定义 Waline 的语言配置
- fr
- vi
- vi-vn
- es
- es-MX

例如:

Expand Down
2 changes: 2 additions & 0 deletions docs/src/reference/client/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Waline 的服务端地址。
- `'ru-RU'`
- `fr-FR`
- `fr`
- `'es'`
- `'es-MX'`

## locale

Expand Down
53 changes: 53 additions & 0 deletions packages/client/src/config/i18n/es.ts
Original file line number Diff line number Diff line change
@@ -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?',
]);
5 changes: 4 additions & 1 deletion packages/client/src/config/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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';
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<string, WalineLocale>;

Expand All @@ -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 =>
Expand Down
2 changes: 1 addition & 1 deletion packages/hexo-next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3f3334

Please sign in to comment.