#Accessing Astro.locals from i18n config

4 messages · Page 1 of 1 (latest)

silent vector
#

Hey everyone, I have a use case where I use the same application for two brands that I store in Astro.locals I'm now facing the challenge of having different content based on the brand in use. I would like to know if somehow I could actually access astro.locas from my ui.ts file to try to relate the translations path based in the brand I'm using. Is it something that any of already tried? Would it be possible somehow?

south meteor
#

You can't access Astro outside .astro files. You'd have to create a function that returns the values you want from ui.ts and pass Astro or Astro.locals as a parameter

silent vector
#

This was helpful

#

thanks