Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translation to Spanish #237

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/utils/datetime.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { format as dateFnsFormat } from "date-fns";
import { enUS, ru } from "date-fns/locale";
import { enUS, ru, es } from "date-fns/locale";

import { storage } from "../data/Storage";

const locales = new Map([
["en", enUS],
["ru", ru],
["es", es],
]);

const defaultLocale = "en";
Expand Down
6 changes: 6 additions & 0 deletions src/utils/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import intervalPlural from "i18next-intervalplural-postprocessor";

import en from "./translations/en";
import ru from "./translations/ru";
import es from "./translations/es";

import { storage } from "../data/Storage";

export const supportedLanguages = new Map([
["en", "english"],
["ru", "русский"],
["es", "español"],
]);

const defaultLanguageCode = "en";
Expand All @@ -26,6 +29,9 @@ export async function init() {
ru: {
translation: ru,
},
es: {
translation: es,
},
},
lng: (await storage.getUnsafe.language()) || navigator.language,
fallbackLng: {
Expand Down
96 changes: 96 additions & 0 deletions src/utils/translations/es.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
const es = {
// Home Tab
Home: "Inicio",
"Period in": "Menstruación en",
"no info": "Desconocido",
Period: "Menstruación",
today: "Hoy",
Delay: "Retraso",
Days: "(0)[Días];(1)[Día];(2-4)[Días];(5-20)[Días];(21)[Día];(22-24)[Días];(25-30)[Días];(31)[Día];(32-34)[Días];(35-40)[Días];",
"Current cycle day": "Día actual del ciclo",
day: "{{count}}º día",
Ovulation: "Ovulación",
possible: "posible hoy",
finished: "Terminado",
tomorrow: "Mañana",
in: "en",
"chance of getting pregnant": "Posibilidad de quedar embarazada",
High: "Alta",
Low: "Baja",
"Period today": "Menstruación hoy",
edit: "Editar",
save: "Guardar",
"Period is": "Menstruación",
"possible today": "Es posible hoy",
// Details Tab
Details: "Detalles",
"Period length": "Duración de la menstruación",
"Cycle length": "Duración del ciclo",
"You haven't marked any periods yet":
"Aún no has marcado ningún día de menstruación",
// Mark Modal
mark: "Marcar",
cancel: "Cancelar",
// Welcome Modal
"Welcome to Peri": "Bienvenida a Peri",
"Mark the days of your": "Marca los días de tu",
"last period": "última menstruación",
Continue: "Continuar",
"Forecast will not be generated.": "No se generará el pronóstico.",
or: "o",
// Info Modal
"Frequent symptoms": "Síntomas frecuentes",
"is current phase of cycle": "- Fase actual del ciclo",
// Phases info
"Menstrual phase": "Fase menstrual",
"This cycle is accompanied by low hormone levels.":
"Este ciclo se acompaña de niveles bajos de hormonas.",
"lack of energy and strength": "Falta de energía y fuerza",
pain: "Dolor",
"weakness and irritability": "Debilidad e irritabilidad",
"increased appetite": "Aumento del apetito",

"Follicular phase": "Fase folicular",
"The level of estrogen in this phase rises and reaches a maximum level.":
"El nivel de estrógeno en esta fase aumenta y alcanza un nivel máximo.",
"strength and vigor appear": "Aparecen la fuerza y el vigor",
"endurance increases": "Aumenta la resistencia",
"new ideas and plans appear": "Aparecen nuevas ideas y planes",
"libido increases": "Aumenta la libido",

"Ovulation phase": "Fase de ovulación",
"Once estrogen levels peak, they trigger the release of two important ovulation hormones, follicle-stimulating hormone and luteinizing hormone.":
"Una vez que los niveles de estrógeno alcanzan su punto máximo, desencadenan la liberación de dos importantes hormonas de la ovulación: la hormona folículo-estimulante y la hormona luteinizante.",
"increased sexual desire": "Aumento del deseo sexual",
"optimistic mood": "Estado de ánimo optimista",
"mild fever": "Fiebre leve",
"lower abdominal pain": "Dolor abdominal bajo",
"chest discomfort and bloating": "Molestias en el pecho e hinchazón",
"characteristic secretions": "Secreciones características",

"Luteal phase": "Fase lútea",
"Levels of the hormones estrogen and progesterone first rise and then drop sharply just before a period. Progesterone reaches its peak in the luteal phase.":
"Los niveles de las hormonas estrógeno y progesterona primero aumentan y luego caen bruscamente justo antes de la menstruación. La progesterona alcanza su punto máximo en la fase lútea.",
"breast tenderness": "Sensibilidad en los senos",
puffiness: "Hinchazón",
"acne and skin rashes": "Acné y erupciones cutáneas",
"diarrhea or constipation": "Diarrea o estreñimiento",
"irritability and depressed mood":
"Irritabilidad y estado de ánimo deprimido",

// Menu
Preferences: "Preferencias",
Edit: "Editar",
Language: "Idioma",
Theme: "Tema",
"Import config": "Importar configuración",
"Export config": "Exportar configuración",
"Configuration has been imported": "La configuración ha sido importada",
"Download latest version": "Descargar la última versión",
// Alert Demo
"This is just a demo": "Esto es solo una demostración",
"You can download the application ": "Puedes descargar la aplicación ",
here: "Aquí",
};

export default es;
Loading