Compare commits

...

1 Commits

Author SHA1 Message Date
Esteban c43a21adc6 added locale json to do fix utls 2026-02-14 22:48:23 -05:00
6 changed files with 39 additions and 1 deletions

View File

@ -1,6 +1,11 @@
--- ---
import Header from './Header.astro'; import Header from './Header.astro';
import { Icon } from 'astro-icon/components'; import { Icon } from 'astro-icon/components';
import { useTranslations } from '../utils/i18n';
// Set the language for translations
const lang = 'es';
const t = useTranslations(lang);
--- ---
<div class="font-secondary"> <div class="font-secondary">
@ -22,7 +27,7 @@ import { Icon } from 'astro-icon/components';
</h1> </h1>
<div class="flex items-center "> <div class="flex items-center ">
<Icon name="ph:minus" class="text-xl mr-2" /> <Icon name="ph:minus" class="text-xl mr-2" />
<h6 class="font-primary font-light uppercase text-white">LÍDER FUNDADOR</h6> <h6 class="font-primary font-light uppercase text-white">{t("hero_section.lider")}</h6>
</div> </div>
</div> </div>

5
src/data/locales/en.json Normal file
View File

@ -0,0 +1,5 @@
{
"hero_section": {
"lider": "LÍDER FUNDADOR"
}
}

5
src/data/locales/es.json Normal file
View File

@ -0,0 +1,5 @@
{
"hero_section": {
"lider": "LÍDER FUNDADOR"
}
}

5
src/data/locales/fr.json Normal file
View File

@ -0,0 +1,5 @@
{
"hero_section": {
"lider": "LÍDER FUNDADOR"
}
}

5
src/data/locales/he.json Normal file
View File

@ -0,0 +1,5 @@
{
"hero_section": {
"lider": "מנהיג מייסד"
}
}

13
src/utils/i18n.js Normal file
View File

@ -0,0 +1,13 @@
import es from '../data/locales/es.json';
import en from '../data/locales/en.json';
import he from '../data/locales/he.json';
import fr from '../data/locales/fr.json';
const languages = { es, en, he, fr };
export function useTranslations(lang) {
return function t(key) {
// return the translation for the given key in the specified language, or fall back to Spanish if the key is not found
return languages[lang][key] || languages['es'][key];
};
}