Getting translated URLs
-
Say I have a CMS page
/about
and a Spanish translation for it with the slug/acerca
Is there a front-end method to get each URL? E.g. I am viewing the site in
en
and want to get thees
version of/about
, which would be/acerca
, and visa-versa?I've read how to get translated routes, but can't find anything about translated CMS pages/slugs.
Thanks
-
OK, just realised I can do
$page->getTranslation('es')->slug
to get a translated URL/slug for the current page, but what if I'm not on that page, what if i'm on the homepage and want to get the translated URL for the/about
page?Thanks