Configuration
Supported Languages
es) as the default language and English (en) as an alternative.
Translation Object
Theui object contains all translation keys for both languages:
Available Translation Keys
Navigation
ES: “Sobre Adosa” | EN: “About Adosa”
ES: “Propiedades” | EN: “Properties”
ES: “Misión” | EN: “Mission”
ES: “Contacto” | EN: “Contact”
Footer
ES: “Todos los derechos reservados” | EN: “All rights reserved”
ES: “Política de privacidad” | EN: “Privacy Policy”
ES: “Política de Cookies” | EN: “Cookies Policy”
Property Details
ES: “Dorm.” | EN: “Beds”
ES: “Baños” | EN: “Baths”
ES: “m² Construido” | EN: “m² Built”
ES: “m² Parcela” | EN: “m² Plot”
ES: “Precio” | EN: “Price”
ES: “Detalles” | EN: “Details”
ES: “Descripción” | EN: “Description”
ES: “Ubicación” | EN: “Location”
ES: “Tipo” | EN: “Type”
ES: “Referencia” | EN: “Reference”
ES: “Cert. Energético” | EN: “Energy Cert.”
ES: “Comunidad” | EN: “Community”
ES: “IBI” | EN: “IBI”
Property Grid Filters
ES: “Ubicación” | EN: “Location”
ES: “Tipología” | EN: “Typology”
ES: “Habitaciones” | EN: “Bedrooms”
ES: “Baños” | EN: “Bathrooms”
ES: “Todos” | EN: “All” (masculine)
ES: “Todas” | EN: “All” (feminine)
ES: “Cualquiera” | EN: “Any”
Property Types
ES: “Apartamento” | EN: “Apartment”
ES: “Casa” | EN: “House”
ES: “Terreno” | EN: “Land”
ES: “Parcela” | EN: “Plots”
ES: “Ático” | EN: “Penthouse”
ES: “Apartamentos” | EN: “Apartments” (plural)
ES: “Casas” | EN: “Houses” (plural)
ES: “Terrenos” | EN: “Lands” (plural)
ES: “Parcelas” | EN: “Plots” (plural)
ES: “Local Comercial” | EN: “Commercial Property”
ES: “DESTACADO” | EN: “FEATURED”
ES: “Dorm.” | EN: “Bed”
ES: “Baño” | EN: “Bath”
Contact Form
ES: “Hablemos” | EN: “Let’s Talk”
ES: “Nombre” | EN: “Name”
ES: “Teléfono” | EN: “Phone”
ES: “Email” | EN: “Email”
ES: “Mensaje” | EN: “Message”
ES: “ENVIAR” | EN: “SEND”
Utility Functions
getLangFromUrl()
Extracts the language code from a URL pathname.
Parameters
URL object to extract language from
Returns
Language code from URL, or default language if not found
Usage Example
useTranslations()
Returns a translation function for the specified language.
Parameters
Language code to use for translations
Returns
Translation function that accepts a key and returns the translated string. Falls back to default language if translation is missing.
Usage Example
In Astro Components
useTranslatedPath()
Returns a function that creates language-prefixed URLs.
Parameters
Current language code
Returns
Function that accepts a path and optional language code, returning the properly prefixed URL. Default language paths have no prefix.
Usage Example
In Language Switcher
getStaticPaths()
Helper function for generating static paths in Astro with language support.
Returns
Array of path configurations for Astro static generation:
{ params: { lang: undefined } }- Default language (Spanish){ params: { lang: 'en' } }- English language
Usage in Astro Pages
Complete Example
Source Locations
src/i18n/ui.ts:1-106- Translation keys and language configurationsrc/i18n/utils.ts:1-27- Utility functions