Hi @AccessAmity ,
Have you read this article from Hubspot? https://knowledge.hubspot.com/articles/kcs_article/cos-general/how-to-manage-multi-language-content-with-hubspots-cos
The coding languages available for development in hubspot are html, css, javascript, and hubl. all of these except hubl are processed by the browser. hubl is a server side language, but it is a templating language, and the last language processed by the server before the pages are served to the browser. I do not see any variables that would supply the user’s location in the HubL supported variable docs, but even with something like that available, the route to the page would have already started the process of serving the page, which would then be interupted by logic in the template to create a redirect.
There are some javascript apis that can detect the user’s location, under the right conditions, but javascript isn’t processed by the browser until after the page has been served to the browser, so it would actually be slower than a template redirect.
html and css are strictly structure and styling so they aren’t any help here.
While it makes since that you would want to avoid a redirect, the redirect provided through the language switcher functionality seams to process before the template, so it would be the fastest. I am only speculating, but I believe that when a user requests a page, Hubspot’s router will check the users location before trying to serve the template. they request a “url”, but the router attempts to check the users language, then redirects them to a new route that then builds the template and serves the page in the correct language.
There has to be some sort of anchor in this situation, otherwise the user’s browser would need to know their language and know what what page to send them to on your site, performing the redirect before the request for the page is sent. That isn’t possible, so your user has to attempt to access your page, and the backend programming has to make these decisions before trying to serve the page.
As far as redirects go, using Hubpot’s default language switcher functionality would be the fastest. I would perform a test as soon as you are able to access the templates. If you are experiencing a noticeable issue with load time, you might want to do a speed check on the template itself.
hopefully this helps answer your question.
Need help? Hire Us Here