feat: add Spanish Language (#31)

* * 🐳 chore(Dockerfile): add Dockerfile for sqlchat
This commit adds a Dockerfile for sqlchat. The Dockerfile is based on Alpine Linux version 3.17 and installs the necessary dependencies for the application to run. The Dockerfile also sets the metadata for the container and copies the application files into the container. The Dockerfile uses pnpm to install the application dependencies and sets the OPENAI_API_KEY and OPENAI_API_ENDPOINT arguments for the container. The CMD instruction specifies the command to run when the container starts, which is to run the application in development mode using pnpm.

* * 🌐 feat(LocaleSelector.tsx): add support for Spanish language
* 🌐 feat(LocaleSwitch.tsx): add support for switching to Spanish language
* 🎨 style(ThemeSwitch.tsx): refactor button JSX for readability
The LocaleSelector component now includes an option for Spanish language. The LocaleSwitch component now includes support for switching to Spanish language. The ThemeSwitch component has been refactored to improve readability of the button JSX.

* 🌐 feat(i18n.ts): add support for Spanish language
A new language, Spanish, has been added to the application. The translations for the new language have been added to the es.json file. The i18n configuration has been updated to include the new language.

*  feat(setting.ts): add support for Spanish language
The Locale type now includes "es" for Spanish language support.

* * 🗑️ chore(Dockerfile): remove Dockerfile
The Dockerfile has been removed from the repository.

* * 🐛 fix(LocaleSwitch.tsx): fix indentation and add missing semicolon
* 🐛 fix(ThemeSwitch.tsx): remove unnecessary code and fix indentation
The LocaleSwitch component had an indentation issue and a missing semicolon. The ThemeSwitch component had unnecessary code that was removed, and the indentation was fixed.
This commit is contained in:
Jorge Thomas - Akrista
2023-04-13 21:00:10 -04:00
committed by GitHub
parent d43fefc7f3
commit cca6cbcad6
5 changed files with 71 additions and 1 deletions

View File

@ -16,6 +16,10 @@ const localeItemList: LocaleItem[] = [
value: "zh",
label: "中文",
},
{
value: "es",
label: "Español",
},
];
const LocaleSelector = () => {

View File

@ -8,6 +8,8 @@ const LocaleSwitch = () => {
const handleLocaleChange = () => {
if (locale === "en") {
settingStore.setLocale("zh");
} else if (locale === "zh") {
settingStore.setLocale("es");
} else {
settingStore.setLocale("en");
}

60
src/locales/es.json Normal file
View File

@ -0,0 +1,60 @@
{
"common": {
"clear": "Limpiar",
"close": "Cerrar",
"confirm": "Confirmar",
"save": "Guardar",
"loading": "Cargando",
"setting": "Configuración",
"copy": "Copiar",
"delete": "Borrar"
},
"conversation": {
"new-chat": "Nuevo Chat",
"conversation-title": "Titulo de conversación",
"edit-title": "Editar Titulo de conversación"
},
"connection": {
"self": "Conexión",
"new": "Crear Conexión",
"select-database": "Selecciona tu base de datos"
},
"execution": {
"title": "Ejecutar consulta",
"message": {
"executing": "Ejecutando consulta...",
"no-connection": "No se ha seleccionado una conexión",
"no-data": "No hay datos para mostrar"
}
},
"editor": {
"placeholder": "Ingresa tu pregunta aquí..."
},
"setting": {
"self": "Configuración",
"basic": {
"self": "Básico",
"language": "Idioma"
},
"theme": {
"self": "Tema",
"system": "Usar tema del sistema",
"light": "Claro",
"dark": "Oscuro"
},
"openai-api-configuration": {
"self": "Configuración del API de OpenAI"
},
"data": {
"self": "Datos",
"clear-all-data": "Limpiar todos los datos"
}
},
"social": {
"join-discord-channel": "Unirse al canal de Discord",
"join-wechat-group": "Unirse al grupo de WeChat"
},
"banner": {
"data-storage": "Las configuraciones de conexión y las consultas se almacenan en tu navegador."
}
}

View File

@ -2,6 +2,7 @@ import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import enLocale from "./en.json";
import zhLocale from "./zh.json";
import esLocale from "./es.json";
i18n.use(initReactI18next).init({
resources: {
@ -11,6 +12,9 @@ i18n.use(initReactI18next).init({
zh: {
translation: zhLocale,
},
es: {
translation: esLocale,
},
},
fallbackLng: "en",
});

View File

@ -1,4 +1,4 @@
export type Locale = "en" | "zh";
export type Locale = "en" | "zh" | "es";
export type Theme = "light" | "dark" | "system";