added locale json to do fix utls
This commit is contained in:
parent
971b413c5a
commit
c43a21adc6
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"hero_section": {
|
||||||
|
"lider": "LÍDER FUNDADOR"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"hero_section": {
|
||||||
|
"lider": "LÍDER FUNDADOR"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"hero_section": {
|
||||||
|
"lider": "LÍDER FUNDADOR"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"hero_section": {
|
||||||
|
"lider": "מנהיג מייסד"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue