Update $this->url for different languages

Permalink
Is there a way to have the $this->url function update automatically if the visitor is viewing a particular language?

My issue right now is if I'm using $this->url('/privacy-policy') and they're on the /es site, then it doesn't add /es to the URL. It still sends them to example.com/privacy-policy instead of example.com/es/privacy-policy.

This is the case even if it's mapped using the Internationalization add-on.

 

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.